https://www.acmicpc.net/problem/1543
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
sb.append(br.readLine());
String findStr = br.readLine();
int count = 0;
int position;
int startIndex = 0;
while (true) {
position = sb.indexOf(findStr, startIndex);
if (position == -1) {
break;
}
startIndex = position+findStr.length();
count++;
}
System.out.println(count);
}
}