#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, res = 0;
  cin >> n >> k;
  int v[81];
  for (int i = 0; i < n; i++) cin >> v[i];
  set<int> library;
  for (int i = 0; i < n; i++) {
    if (library.count(v[i])) continue;
    if (library.size() >= k) {
      int f[100] = {};
      int t = 0, mn = -1e9;
      for (int j = i + 1; j < n; j++)
        if (!f[v[j]]) f[v[j]] = j;
      for (int j : library) {
        if (!f[j]) {
          t = j;
          break;
        }
        if (mn < f[j]) t = j, mn = f[j];
      }
      library.erase(t);
    }
    library.insert(v[i]);
    res++;
  }
  cout << res;
}
