import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String string = scanner.nextLine();
String character = scanner.nextLine();
Pattern compile = Pattern.compile(character, Pattern.CASE_INSENSITIVE);
Matcher matcher = compile.matcher(string);
int count = 0;
while (matcher.find()) {
count++;
}
System.out.println(count);
}
}