#include <iostream>
#include <algorithm>
#include <set>
#include <map>
using namespace std;
int arr[14];
int ans = 0;
void check(int w)
{
int maxnum = 0;
int maxchoice = 0;
int maxcnt = 0;
int maxn = 0;
int maxindex = 0;
for (int i = 0; i < 13; i++)
{
if (maxn < arr[i]) {
maxn = arr[i];
maxindex = i;
}
}
for (int i = 1; i < (1 << 14) - 1; i++)
{
int temp = (i | (1 << maxindex));
int sum = 0;
int cnt = 0;
for (int j = 0; j < 13 && temp != 0; j++)
{
if (temp & 1)
{
sum += arr[j];
cnt++;
}
temp >>= 1;
}
if (sum >= maxnum && sum <= w)
{
if (sum > maxnum) {
maxchoice = (i | (1 << maxindex));
maxcnt = cnt;
}
maxnum = sum;
if (cnt > maxcnt) {
maxcnt = cnt;
maxchoice = (i | (1 << maxindex));
}
}
}
int sum = 0;
for (int j = 0; j < 13 && maxchoice != 0; j++)
{
if (maxchoice & 1)
{
//if (arr[j] != 0) {
// cout << arr[j] << " ";
// sum += arr[j];
//}
arr[j] = 0;
}
maxchoice >>= 1;
}
//cout << "sum = "<<sum << endl;
if (maxnum != 0)
{
ans++;
check(w);
}
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
long long n, m, temp;
cin >> n >> m;
for (int i = 0; i < n; i++)
{
cin >> temp;
arr[temp - 1]++;
//cin >> arr[i];
}
sort(arr, arr + 13);
//if (n == 6542) {
// for (int i = 0; i < 13; i++)
// {
// cout << arr[i] << " ";
// }
//}
check(m);
cout << ans << endl;
return 0;
}