import java.util.*;
 
public class Main {
    private static final Scanner scn = new Scanner(System.in);
     
    public static void main(String[] args) {
        String ptn = scn.next().toLowerCase();
        ArrayList<String> als = new ArrayList<>();
        while(scn.hasNext()) {
            als.add(scn.next().toLowerCase());
        }
        System.out.println(Collections.frequency(als, ptn));
    }
} import java.util.*; util.* java public class Main {
    private static final Scanner scn = new Scanner(System.in);
     
    public static void main(String[] args) {
        String ptn = scn.next().toLowerCase();
        ArrayList<String> als = new ArrayList<>();
        while(scn.hasNext()) {
            als.add(scn.next().toLowerCase());
        }
        System.out.println(Collections.frequency(als, ptn));
    }
} Main private static final Scanner scn = new Scanner(System.in); scn new Scanner(System.in) public static void main(String[] args) {
        String ptn = scn.next().toLowerCase();
        ArrayList<String> als = new ArrayList<>();
        while(scn.hasNext()) {
            als.add(scn.next().toLowerCase());
        }
        System.out.println(Collections.frequency(als, ptn));
    } main {
        String ptn = scn.next().toLowerCase();
        ArrayList<String> als = new ArrayList<>();
        while(scn.hasNext()) {
            als.add(scn.next().toLowerCase());
        }
        System.out.println(Collections.frequency(als, ptn));
    } String ptn = scn.next().toLowerCase(); ptn scn.next().toLowerCase() scn.next().toLowerCase scn.next() scn.next scn ArrayList<String> als = new ArrayList<>(); als new ArrayList<>() while(scn.hasNext()) {
            als.add(scn.next().toLowerCase());
        } scn.hasNext() scn.hasNext scn {
            als.add(scn.next().toLowerCase());
        } als.add(scn.next().toLowerCase()) als.add als scn.next().toLowerCase() scn.next().toLowerCase scn.next() scn.next scn System.out.println(Collections.frequency(als, ptn)) System.out.println System.out System System.out Collections.frequency(als, ptn) Collections.frequency Collections als ptn String[] args args public class Main {
    private static final Scanner scn = new Scanner(System.in);
     
    public static void main(String[] args) {
        String ptn = scn.next().toLowerCase();
        ArrayList<String> als = new ArrayList<>();
        while(scn.hasNext()) {
            als.add(scn.next().toLowerCase());
        }
        System.out.println(Collections.frequency(als, ptn));
    }
} public class Main {
    private static final Scanner scn = new Scanner(System.in);
     
    public static void main(String[] args) {
        String ptn = scn.next().toLowerCase();
        ArrayList<String> als = new ArrayList<>();
        while(scn.hasNext()) {
            als.add(scn.next().toLowerCase());
        }
        System.out.println(Collections.frequency(als, ptn));
    }
} Main
import java.util.*;
 
public class Main {
    private static final Scanner scn = new Scanner(System.in);
     
    public static void main(String[] args) {
        String ptn = scn.next().toLowerCase();
        ArrayList<String> als = new ArrayList<>();
        while(scn.hasNext()) {
            als.add(scn.next().toLowerCase());
        }
        System.out.println(Collections.frequency(als, ptn));
    }
}