#include <stdio.h>

int main(){
    int N;
    int K;
    int A[100][100];
    int d[100];
    int j;
    scanf("%d %d",&N,&K);
    scanf("%d",&d[1]);
    for (int i=0; i<=d[1]; i=i+1) {
        scanf("%d",&A[1][i]);
    }
    scanf("%d",&d[K]);
    int num=N;
    j=N-d[1];
    for (int i=0; i<=d[K]; i=i+1) {
        scanf("%d",&A[K][i]);
    }
    for (int m=0; m<=K; m++) {
        for (int i=0; i<=N; i=i+1) {
            if(A[m][i]==A[1][i]){
                num=num-1;
            }
        }
    }
    j=j-num;
    printf("%d",j);
}
