I need logic for the following program. please help me

Question :
Accept 2 strings and check how many times the second string is in the first string.

Example1:

Enter main string : This is...