#include <iostream>
using namespace std;
int m, n, w;
int nc[10000] = {}, s = 0, e = 0;
bool findnc(int x)
{
for (int i = s; i < e; i++)
if (nc[i] == x)
return true;
return false;
}
void addnc(int x)
{
if (e - s == m)
{
nc[e++] = x;
s++;
}
else
nc[e++] = x;
}
int main()
{
cin >> m >> n;
int ans = 0;
while (n--)
{
cin >> w;
if (findnc(w))
continue;
else
{
ans++;
addnc(w);
}
}
cout << ans;
return 0;
}