import java.util.; import java.io.; public class Main{ public static void main(String[]args)throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String str = in.readLine().toLowerCase(); String s = in.readLine().toLowerCase(); System.out.println(str.length() - str.replaceAll(s,"").length()); } } // import java.util.*; // public class Main{ // public static void main(String[] args){ // Scanner sc = new Scanner(System.in); // String str =sc.nextLine().toLowerCase(); // String s = sc.nextLine().toLowerCase(); // System.out.print(str.length()-str.replaceAll(s,"").length()); // } // }