public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s1 = sc.nextLine();
String s2 = sc.nextLine();
String s3 = s1.toUpperCase().replaceAll(s2.toUpperCase(),"");
System.out.print(s1.length()-s3.length());
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s1 = sc.nextLine();
String s2 = sc.nextLine();
String s3 = s1.toUpperCase().replaceAll(s2.toUpperCase(),"");
System.out.print(s1.length()-s3.length());
}