
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        String word;
        Scanner sc =new Scanner(System.in);
        String key = sc.next();
        String end = "END_OF_TEXT";

        int n;
        int m;
        int count=0;
        while(true){

            word=sc.next();
            if(end.equals(word)) {
                System.out.println(count);
                break;
            }
            else if(key.equalsIgnoreCase(word)) {
                count = count + 1;
            }
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args){
        String word;
        Scanner sc =new Scanner(System.in);
        String key = sc.next();
        String end = "END_OF_TEXT";

        int n;
        int m;
        int count=0;
        while(true){

            word=sc.next();
            if(end.equals(word)) {
                System.out.println(count);
                break;
            }
            else if(key.equalsIgnoreCase(word)) {
                count = count + 1;
            }
        }
    }
} Main public static void main(String[] args){
        String word;
        Scanner sc =new Scanner(System.in);
        String key = sc.next();
        String end = "END_OF_TEXT";

        int n;
        int m;
        int count=0;
        while(true){

            word=sc.next();
            if(end.equals(word)) {
                System.out.println(count);
                break;
            }
            else if(key.equalsIgnoreCase(word)) {
                count = count + 1;
            }
        }
    } main {
        String word;
        Scanner sc =new Scanner(System.in);
        String key = sc.next();
        String end = "END_OF_TEXT";

        int n;
        int m;
        int count=0;
        while(true){

            word=sc.next();
            if(end.equals(word)) {
                System.out.println(count);
                break;
            }
            else if(key.equalsIgnoreCase(word)) {
                count = count + 1;
            }
        }
    } String word; word Scanner sc =new Scanner(System.in); sc new Scanner(System.in) String key = sc.next(); key sc.next() sc.next sc String end = "END_OF_TEXT"; end "END_OF_TEXT" int n; n int m; m int count=0; count 0 while(true){

            word=sc.next();
            if(end.equals(word)) {
                System.out.println(count);
                break;
            }
            else if(key.equalsIgnoreCase(word)) {
                count = count + 1;
            }
        } true {

            word=sc.next();
            if(end.equals(word)) {
                System.out.println(count);
                break;
            }
            else if(key.equalsIgnoreCase(word)) {
                count = count + 1;
            }
        } word=sc.next() word sc.next() sc.next sc if(end.equals(word)) {
                System.out.println(count);
                break;
            }
            else if(key.equalsIgnoreCase(word)) {
                count = count + 1;
            } end.equals(word) end.equals end word {
                System.out.println(count);
                break;
            } System.out.println(count) System.out.println System.out System System.out count break; if(key.equalsIgnoreCase(word)) {
                count = count + 1;
            } key.equalsIgnoreCase(word) key.equalsIgnoreCase key word {
                count = count + 1;
            } count = count + 1 count count + 1 count 1 String[] args args public class Main {
    public static void main(String[] args){
        String word;
        Scanner sc =new Scanner(System.in);
        String key = sc.next();
        String end = "END_OF_TEXT";

        int n;
        int m;
        int count=0;
        while(true){

            word=sc.next();
            if(end.equals(word)) {
                System.out.println(count);
                break;
            }
            else if(key.equalsIgnoreCase(word)) {
                count = count + 1;
            }
        }
    }
} public class Main {
    public static void main(String[] args){
        String word;
        Scanner sc =new Scanner(System.in);
        String key = sc.next();
        String end = "END_OF_TEXT";

        int n;
        int m;
        int count=0;
        while(true){

            word=sc.next();
            if(end.equals(word)) {
                System.out.println(count);
                break;
            }
            else if(key.equalsIgnoreCase(word)) {
                count = count + 1;
            }
        }
    }
} Main

import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        String word;
        Scanner sc =new Scanner(System.in);
        String key = sc.next();
        String end = "END_OF_TEXT";

        int n;
        int m;
        int count=0;
        while(true){

            word=sc.next();
            if(end.equals(word)) {
                System.out.println(count);
                break;
            }
            else if(key.equalsIgnoreCase(word)) {
                count = count + 1;
            }
        }
    }
}
