#include <bits/stdc++.h>
using namespace std;
const int mx = 88;
int a[mx];
int pos[mx];
int nxt[mx];
bool inq[mx];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  for (int i = 0; i <= n; i++) pos[i] = n;
  for (int i = n - 1; i >= 0; i--) {
    nxt[i] = pos[a[i]];
    pos[a[i]] = i;
  }
  set<int> s;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (s.count(i) == 0) {
      ans++;
      if ((int)s.size() == k) {
        auto it = s.end();
        --it;
        s.erase(it);
      }
    }
    s.erase(i);
    s.insert(nxt[i]);
  }
  printf("%d\n", ans);
  return 0;
}
