import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;

public class Main{
    public static void main(String[] args) throws IOException {

	BufferedReader br = null;

	try {
	    br = new BufferedReader(new InputStreamReader(System.in));
	    List<String> lines = new ArrayList<String>();

	    for (String line = br.readLine(); line != null; line = br.readLine()) {
		lines.add(line);
	    }

	    /**

	    lines.add("aaaaaaaaaa");
	    lines.add("bb bb bb aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaa aaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa xxx xxxxxxxxx aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa b b b b b b b aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaaa a a a a");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa a a a a");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x x x x");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x x xaaaaaaaaaa");
	    lines.add("END_OF_TEXT"); */

	    String keyword = lines.get(0).toLowerCase();
	    Integer count = 0;

	    for (int i = 1; i < lines.size() - 1; i++) {
		for (String e : lines.get(i).split(" ")) {
		    String word = e.toLowerCase();
		    if (word.equals(keyword)) {
			count++;
		    }
		}
	    }

	    System.out.println(count);
	    System.exit(0);

	} catch (Exception e) {
	    System.out.println(e.getMessage());
	    System.out.println(Arrays.toString(e.getStackTrace()));
	    System.exit(0);
	} finally {
	    br.close();
	}
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io import java.util.Arrays; Arrays java.util import java.util.List; List java.util import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Comparator; Comparator java.util public class Main{
    public static void main(String[] args) throws IOException {

	BufferedReader br = null;

	try {
	    br = new BufferedReader(new InputStreamReader(System.in));
	    List<String> lines = new ArrayList<String>();

	    for (String line = br.readLine(); line != null; line = br.readLine()) {
		lines.add(line);
	    }

	    /**

	    lines.add("aaaaaaaaaa");
	    lines.add("bb bb bb aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaa aaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa xxx xxxxxxxxx aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa b b b b b b b aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaaa a a a a");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa a a a a");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x x x x");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x x xaaaaaaaaaa");
	    lines.add("END_OF_TEXT"); */

	    String keyword = lines.get(0).toLowerCase();
	    Integer count = 0;

	    for (int i = 1; i < lines.size() - 1; i++) {
		for (String e : lines.get(i).split(" ")) {
		    String word = e.toLowerCase();
		    if (word.equals(keyword)) {
			count++;
		    }
		}
	    }

	    System.out.println(count);
	    System.exit(0);

	} catch (Exception e) {
	    System.out.println(e.getMessage());
	    System.out.println(Arrays.toString(e.getStackTrace()));
	    System.exit(0);
	} finally {
	    br.close();
	}
    }
} Main public static void main(String[] args) throws IOException {

	BufferedReader br = null;

	try {
	    br = new BufferedReader(new InputStreamReader(System.in));
	    List<String> lines = new ArrayList<String>();

	    for (String line = br.readLine(); line != null; line = br.readLine()) {
		lines.add(line);
	    }

	    /**

	    lines.add("aaaaaaaaaa");
	    lines.add("bb bb bb aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaa aaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa xxx xxxxxxxxx aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa b b b b b b b aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaaa a a a a");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa a a a a");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x x x x");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x x xaaaaaaaaaa");
	    lines.add("END_OF_TEXT"); */

	    String keyword = lines.get(0).toLowerCase();
	    Integer count = 0;

	    for (int i = 1; i < lines.size() - 1; i++) {
		for (String e : lines.get(i).split(" ")) {
		    String word = e.toLowerCase();
		    if (word.equals(keyword)) {
			count++;
		    }
		}
	    }

	    System.out.println(count);
	    System.exit(0);

	} catch (Exception e) {
	    System.out.println(e.getMessage());
	    System.out.println(Arrays.toString(e.getStackTrace()));
	    System.exit(0);
	} finally {
	    br.close();
	}
    } main {

	BufferedReader br = null;

	try {
	    br = new BufferedReader(new InputStreamReader(System.in));
	    List<String> lines = new ArrayList<String>();

	    for (String line = br.readLine(); line != null; line = br.readLine()) {
		lines.add(line);
	    }

	    /**

	    lines.add("aaaaaaaaaa");
	    lines.add("bb bb bb aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaa aaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa xxx xxxxxxxxx aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa b b b b b b b aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaaa a a a a");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa a a a a");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x x x x");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x x xaaaaaaaaaa");
	    lines.add("END_OF_TEXT"); */

	    String keyword = lines.get(0).toLowerCase();
	    Integer count = 0;

	    for (int i = 1; i < lines.size() - 1; i++) {
		for (String e : lines.get(i).split(" ")) {
		    String word = e.toLowerCase();
		    if (word.equals(keyword)) {
			count++;
		    }
		}
	    }

	    System.out.println(count);
	    System.exit(0);

	} catch (Exception e) {
	    System.out.println(e.getMessage());
	    System.out.println(Arrays.toString(e.getStackTrace()));
	    System.exit(0);
	} finally {
	    br.close();
	}
    } BufferedReader br = null; br null try {
	    br = new BufferedReader(new InputStreamReader(System.in));
	    List<String> lines = new ArrayList<String>();

	    for (String line = br.readLine(); line != null; line = br.readLine()) {
		lines.add(line);
	    }

	    /**

	    lines.add("aaaaaaaaaa");
	    lines.add("bb bb bb aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaa aaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa xxx xxxxxxxxx aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa b b b b b b b aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaaa a a a a");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa a a a a");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x x x x");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x x xaaaaaaaaaa");
	    lines.add("END_OF_TEXT"); */

	    String keyword = lines.get(0).toLowerCase();
	    Integer count = 0;

	    for (int i = 1; i < lines.size() - 1; i++) {
		for (String e : lines.get(i).split(" ")) {
		    String word = e.toLowerCase();
		    if (word.equals(keyword)) {
			count++;
		    }
		}
	    }

	    System.out.println(count);
	    System.exit(0);

	} catch (Exception e) {
	    System.out.println(e.getMessage());
	    System.out.println(Arrays.toString(e.getStackTrace()));
	    System.exit(0);
	} finally {
	    br.close();
	} catch (Exception e) {
	    System.out.println(e.getMessage());
	    System.out.println(Arrays.toString(e.getStackTrace()));
	    System.exit(0);
	} Exception e {
	    System.out.println(e.getMessage());
	    System.out.println(Arrays.toString(e.getStackTrace()));
	    System.exit(0);
	} System.out.println(e.getMessage()) System.out.println System.out System System.out e.getMessage() e.getMessage e System.out.println(Arrays.toString(e.getStackTrace())) System.out.println System.out System System.out Arrays.toString(e.getStackTrace()) Arrays.toString Arrays e.getStackTrace() e.getStackTrace e System.exit(0) System.exit System 0 {
	    br.close();
	} br.close() br.close br {
	    br = new BufferedReader(new InputStreamReader(System.in));
	    List<String> lines = new ArrayList<String>();

	    for (String line = br.readLine(); line != null; line = br.readLine()) {
		lines.add(line);
	    }

	    /**

	    lines.add("aaaaaaaaaa");
	    lines.add("bb bb bb aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaa aaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa xxx xxxxxxxxx aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa b b b b b b b aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaaa a a a a");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa a a a a");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x x x x");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x x xaaaaaaaaaa");
	    lines.add("END_OF_TEXT"); */

	    String keyword = lines.get(0).toLowerCase();
	    Integer count = 0;

	    for (int i = 1; i < lines.size() - 1; i++) {
		for (String e : lines.get(i).split(" ")) {
		    String word = e.toLowerCase();
		    if (word.equals(keyword)) {
			count++;
		    }
		}
	    }

	    System.out.println(count);
	    System.exit(0);

	} br = new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) List<String> lines = new ArrayList<String>(); lines new ArrayList<String>() for (String line = br.readLine(); line != null; line = br.readLine()) {
		lines.add(line);
	    } String line = br.readLine(); String line = br.readLine(); line br.readLine() br.readLine br line != null line null line = br.readLine() line = br.readLine() line br.readLine() br.readLine br {
		lines.add(line);
	    } {
		lines.add(line);
	    } lines.add(line) lines.add lines line String keyword = lines.get(0).toLowerCase(); keyword lines.get(0).toLowerCase() lines.get(0).toLowerCase lines.get(0) lines.get lines 0 Integer count = 0; count 0 for (int i = 1; i < lines.size() - 1; i++) {
		for (String e : lines.get(i).split(" ")) {
		    String word = e.toLowerCase();
		    if (word.equals(keyword)) {
			count++;
		    }
		}
	    } int i = 1; int i = 1; i 1 i < lines.size() - 1 i lines.size() - 1 lines.size() lines.size lines 1 i++ i++ i {
		for (String e : lines.get(i).split(" ")) {
		    String word = e.toLowerCase();
		    if (word.equals(keyword)) {
			count++;
		    }
		}
	    } {
		for (String e : lines.get(i).split(" ")) {
		    String word = e.toLowerCase();
		    if (word.equals(keyword)) {
			count++;
		    }
		}
	    } for (String e : lines.get(i).split(" ")) {
		    String word = e.toLowerCase();
		    if (word.equals(keyword)) {
			count++;
		    }
		} String e lines.get(i).split(" ") lines.get(i).split lines.get(i) lines.get lines i " " {
		    String word = e.toLowerCase();
		    if (word.equals(keyword)) {
			count++;
		    }
		} {
		    String word = e.toLowerCase();
		    if (word.equals(keyword)) {
			count++;
		    }
		} String word = e.toLowerCase(); word e.toLowerCase() e.toLowerCase e if (word.equals(keyword)) {
			count++;
		    } word.equals(keyword) word.equals word keyword {
			count++;
		    } count++ count System.out.println(count) System.out.println System.out System System.out count System.exit(0) System.exit System 0 String[] args args public class Main{
    public static void main(String[] args) throws IOException {

	BufferedReader br = null;

	try {
	    br = new BufferedReader(new InputStreamReader(System.in));
	    List<String> lines = new ArrayList<String>();

	    for (String line = br.readLine(); line != null; line = br.readLine()) {
		lines.add(line);
	    }

	    /**

	    lines.add("aaaaaaaaaa");
	    lines.add("bb bb bb aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaa aaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa xxx xxxxxxxxx aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa b b b b b b b aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaaa a a a a");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa a a a a");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x x x x");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x x xaaaaaaaaaa");
	    lines.add("END_OF_TEXT"); */

	    String keyword = lines.get(0).toLowerCase();
	    Integer count = 0;

	    for (int i = 1; i < lines.size() - 1; i++) {
		for (String e : lines.get(i).split(" ")) {
		    String word = e.toLowerCase();
		    if (word.equals(keyword)) {
			count++;
		    }
		}
	    }

	    System.out.println(count);
	    System.exit(0);

	} catch (Exception e) {
	    System.out.println(e.getMessage());
	    System.out.println(Arrays.toString(e.getStackTrace()));
	    System.exit(0);
	} finally {
	    br.close();
	}
    }
} public class Main{
    public static void main(String[] args) throws IOException {

	BufferedReader br = null;

	try {
	    br = new BufferedReader(new InputStreamReader(System.in));
	    List<String> lines = new ArrayList<String>();

	    for (String line = br.readLine(); line != null; line = br.readLine()) {
		lines.add(line);
	    }

	    /**

	    lines.add("aaaaaaaaaa");
	    lines.add("bb bb bb aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaa aaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa xxx xxxxxxxxx aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa b b b b b b b aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaaa a a a a");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa a a a a");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x x x x");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x x xaaaaaaaaaa");
	    lines.add("END_OF_TEXT"); */

	    String keyword = lines.get(0).toLowerCase();
	    Integer count = 0;

	    for (int i = 1; i < lines.size() - 1; i++) {
		for (String e : lines.get(i).split(" ")) {
		    String word = e.toLowerCase();
		    if (word.equals(keyword)) {
			count++;
		    }
		}
	    }

	    System.out.println(count);
	    System.exit(0);

	} catch (Exception e) {
	    System.out.println(e.getMessage());
	    System.out.println(Arrays.toString(e.getStackTrace()));
	    System.exit(0);
	} finally {
	    br.close();
	}
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;

public class Main{
    public static void main(String[] args) throws IOException {

	BufferedReader br = null;

	try {
	    br = new BufferedReader(new InputStreamReader(System.in));
	    List<String> lines = new ArrayList<String>();

	    for (String line = br.readLine(); line != null; line = br.readLine()) {
		lines.add(line);
	    }

	    /**

	    lines.add("aaaaaaaaaa");
	    lines.add("bb bb bb aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaa aaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa xxx xxxxxxxxx aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa b b b b b b b aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaaa a a a a");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa a a a a");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x x x x");
	    lines.add("aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa x x xaaaaaaaaaa");
	    lines.add("END_OF_TEXT"); */

	    String keyword = lines.get(0).toLowerCase();
	    Integer count = 0;

	    for (int i = 1; i < lines.size() - 1; i++) {
		for (String e : lines.get(i).split(" ")) {
		    String word = e.toLowerCase();
		    if (word.equals(keyword)) {
			count++;
		    }
		}
	    }

	    System.out.println(count);
	    System.exit(0);

	} catch (Exception e) {
	    System.out.println(e.getMessage());
	    System.out.println(Arrays.toString(e.getStackTrace()));
	    System.exit(0);
	} finally {
	    br.close();
	}
    }
}