import java.util.*;

public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int cnt = 0;
        String ptn = scn.next();
        while(scn.hasNext()) {
            cnt += ptn.equalsIgnoreCase(scn.next()) ? 1 : 0;
        }
        System.out.println(cnt);
    }
} import java.util.*; util.* java public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int cnt = 0;
        String ptn = scn.next();
        while(scn.hasNext()) {
            cnt += ptn.equalsIgnoreCase(scn.next()) ? 1 : 0;
        }
        System.out.println(cnt);
    }
} Main private static final Scanner scn = new Scanner(System.in); scn new Scanner(System.in) public static void main(String[] args) {
        int cnt = 0;
        String ptn = scn.next();
        while(scn.hasNext()) {
            cnt += ptn.equalsIgnoreCase(scn.next()) ? 1 : 0;
        }
        System.out.println(cnt);
    } main {
        int cnt = 0;
        String ptn = scn.next();
        while(scn.hasNext()) {
            cnt += ptn.equalsIgnoreCase(scn.next()) ? 1 : 0;
        }
        System.out.println(cnt);
    } int cnt = 0; cnt 0 String ptn = scn.next(); ptn scn.next() scn.next scn while(scn.hasNext()) {
            cnt += ptn.equalsIgnoreCase(scn.next()) ? 1 : 0;
        } scn.hasNext() scn.hasNext scn {
            cnt += ptn.equalsIgnoreCase(scn.next()) ? 1 : 0;
        } cnt += ptn.equalsIgnoreCase(scn.next()) ? 1 : 0 cnt ptn.equalsIgnoreCase(scn.next()) ? 1 : 0 ptn.equalsIgnoreCase(scn.next()) ptn.equalsIgnoreCase ptn scn.next() scn.next scn 1 0 System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int cnt = 0;
        String ptn = scn.next();
        while(scn.hasNext()) {
            cnt += ptn.equalsIgnoreCase(scn.next()) ? 1 : 0;
        }
        System.out.println(cnt);
    }
} public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int cnt = 0;
        String ptn = scn.next();
        while(scn.hasNext()) {
            cnt += ptn.equalsIgnoreCase(scn.next()) ? 1 : 0;
        }
        System.out.println(cnt);
    }
} Main
import java.util.*;

public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int cnt = 0;
        String ptn = scn.next();
        while(scn.hasNext()) {
            cnt += ptn.equalsIgnoreCase(scn.next()) ? 1 : 0;
        }
        System.out.println(cnt);
    }
}