#include <fstream>
#include <iostream>
using namespace std;
int main()
{
int n;
int m;
int a[101];
int i,j,k,l;
int min;
bool b;
ifstream fin("translate.in");
ofstream fout("translate.out");
fin>>n>>m;
for (i=1;i<=n;i++)
a[i]=-1;
min=0;
l=1;
for (i=1;i<=m;i++)
{
b=true;
fin>>j;
for (k=1;k<=n;k++)
if (a[k]==j)
{
b=false;
break;
}
if (b)
{
min++;
a[l]=j;
l++;
if (l==n+1)
l=1;
}
}
fout<<min;
fin.close();
fout.close();
return 0;
}