#include <bits/stdc++.h>
const int MAXN = 80 + 1;
int a[MAXN], last[MAXN], next[MAXN];
std::vector<int> lib;
int main(int argc, char *argv[]) {
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  int cost = 0;
  for (int i = 1; i <= n; i++) {
    if (find(lib.begin(), lib.end(), a[i]) != lib.end()) continue;
    if (lib.size() < k) {
      lib.push_back(a[i]);
      cost++;
    } else {
      int next = 0, id;
      std::vector<int>::iterator p;
      for (std::vector<int>::iterator it = lib.begin(); it != lib.end(); it++) {
        for (id = i + 1; id <= n; id++) {
          if (*it == a[id]) break;
        }
        if (id > next) next = id, p = it;
      }
      lib.erase(p);
      lib.push_back(a[i]);
      cost++;
    }
  }
  printf("%d\n", cost);
  return 0;
}
