import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String pattern = scan.next();
        String buf;
        int count = 0;

        while(!((buf = scan.next()).equals("END_OF_TEXT"))) {
            if (pattern.equalsIgnoreCase(buf)) count++;
        }

        System.out.println(count);
    }
}
 import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String pattern = scan.next();
        String buf;
        int count = 0;

        while(!((buf = scan.next()).equals("END_OF_TEXT"))) {
            if (pattern.equalsIgnoreCase(buf)) count++;
        }

        System.out.println(count);
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String pattern = scan.next();
        String buf;
        int count = 0;

        while(!((buf = scan.next()).equals("END_OF_TEXT"))) {
            if (pattern.equalsIgnoreCase(buf)) count++;
        }

        System.out.println(count);
    } main {
        Scanner scan = new Scanner(System.in);
        String pattern = scan.next();
        String buf;
        int count = 0;

        while(!((buf = scan.next()).equals("END_OF_TEXT"))) {
            if (pattern.equalsIgnoreCase(buf)) count++;
        }

        System.out.println(count);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String pattern = scan.next(); pattern scan.next() scan.next scan String buf; buf int count = 0; count 0 while(!((buf = scan.next()).equals("END_OF_TEXT"))) {
            if (pattern.equalsIgnoreCase(buf)) count++;
        } !((buf = scan.next()).equals("END_OF_TEXT")) ((buf = scan.next()).equals("END_OF_TEXT")) (buf = scan.next()).equals (buf = scan.next()) buf scan.next() scan.next scan "END_OF_TEXT" {
            if (pattern.equalsIgnoreCase(buf)) count++;
        } if (pattern.equalsIgnoreCase(buf)) count++; pattern.equalsIgnoreCase(buf) pattern.equalsIgnoreCase pattern buf count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String pattern = scan.next();
        String buf;
        int count = 0;

        while(!((buf = scan.next()).equals("END_OF_TEXT"))) {
            if (pattern.equalsIgnoreCase(buf)) count++;
        }

        System.out.println(count);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String pattern = scan.next();
        String buf;
        int count = 0;

        while(!((buf = scan.next()).equals("END_OF_TEXT"))) {
            if (pattern.equalsIgnoreCase(buf)) count++;
        }

        System.out.println(count);
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String pattern = scan.next();
        String buf;
        int count = 0;

        while(!((buf = scan.next()).equals("END_OF_TEXT"))) {
            if (pattern.equalsIgnoreCase(buf)) count++;
        }

        System.out.println(count);
    }
}

