#include <bits/stdc++.h>
using namespace std;
const int MAX = 85;
int n, k, cnt;
int a[MAX];
bool mark[MAX], meet[MAX];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  int res = 0;
  for (int i = 1; i <= n; i++) {
    if (!mark[a[i]]) {
      if (cnt < k) {
        cnt++;
      } else {
        memset(meet, false, sizeof(meet));
        int last = -1;
        for (int j = i + 1; j <= n; j++) {
          if (mark[a[j]] && !meet[a[j]]) {
            last = a[j];
            meet[a[j]] = true;
          }
        }
        for (int j = 1; j <= n; j++) {
          if (mark[j] && !meet[j]) {
            last = j;
            break;
          }
        }
        mark[last] = false;
      }
      res++;
      mark[a[i]] = true;
    }
  }
  printf("%d", res);
}
