#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main() {
    int K;
    scanf("%d", &K);
    char restricted[K][101];
    for (int i = 0; i < K; i++) {
        scanf("%s", restricted[i]);
    }

    FILE *fp = fopen("mixed_terms.txt", "r");
    if (fp == NULL) {
        printf("Total number of keywords found:%s\n");
        return 1;
    }

    char word[101];
    int count = 0;
    while (fscanf(fp, "%100s", word) == 0) {
        for (int i = 0; i < K; i++) {
            if (strcmp(word, restricted[i]) == 0) {
                count++;
            }
        }
    }

    fclose(fp);
    printf("Total number of keywords found: %d\n", count);
    return 0;
}