import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String word = sc.next();
        String text;
        int count = 0;
        while (!(text=sc.next()).equals("END_OF_TEXT")) {
            if (text.toLowerCase().equals(word)) count++;
        }
        System.out.println(count);
    }
}
 import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String word = sc.next();
        String text;
        int count = 0;
        while (!(text=sc.next()).equals("END_OF_TEXT")) {
            if (text.toLowerCase().equals(word)) count++;
        }
        System.out.println(count);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String word = sc.next();
        String text;
        int count = 0;
        while (!(text=sc.next()).equals("END_OF_TEXT")) {
            if (text.toLowerCase().equals(word)) count++;
        }
        System.out.println(count);
    } main {
        Scanner sc = new Scanner(System.in);
        String word = sc.next();
        String text;
        int count = 0;
        while (!(text=sc.next()).equals("END_OF_TEXT")) {
            if (text.toLowerCase().equals(word)) count++;
        }
        System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String word = sc.next(); word sc.next() sc.next sc String text; text int count = 0; count 0 while (!(text=sc.next()).equals("END_OF_TEXT")) {
            if (text.toLowerCase().equals(word)) count++;
        } !(text=sc.next()).equals("END_OF_TEXT") (text=sc.next()).equals("END_OF_TEXT") (text=sc.next()).equals (text=sc.next()) text sc.next() sc.next sc "END_OF_TEXT" {
            if (text.toLowerCase().equals(word)) count++;
        } if (text.toLowerCase().equals(word)) count++; text.toLowerCase().equals(word) text.toLowerCase().equals text.toLowerCase() text.toLowerCase text word 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 sc = new Scanner(System.in);
        String word = sc.next();
        String text;
        int count = 0;
        while (!(text=sc.next()).equals("END_OF_TEXT")) {
            if (text.toLowerCase().equals(word)) count++;
        }
        System.out.println(count);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String word = sc.next();
        String text;
        int count = 0;
        while (!(text=sc.next()).equals("END_OF_TEXT")) {
            if (text.toLowerCase().equals(word)) count++;
        }
        System.out.println(count);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String word = sc.next();
        String text;
        int count = 0;
        while (!(text=sc.next()).equals("END_OF_TEXT")) {
            if (text.toLowerCase().equals(word)) count++;
        }
        System.out.println(count);
    }
}

