m, n = map(int, input().strip().split())
w, t, c = list(map(int, input().strip().split())), [], 0
for i in w:
    if i in t:
        continue
    else:
        if len(t) >= m:
            t.pop(0)
        c += 1
        t.append(i)
print(c)