n,k = map(int,input().split()) *a, = map(int,input().split()) N = 1<= k: ans.add(s[i]) ans.add(p[i]) print(len(ans))