#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, k;
  cin >> n >> k;
  int a[n];
  int c[81] = {0};
  for (i = 0; i < n; i++) {
    cin >> a[i];
    c[a[i]]++;
  }
  set<int> s;
  int min, mn, b = 0, j, occ, f;
  int ar[81] = {0};
  for (i = 0; i < n; i++) {
    if ((s.size() == k) && (ar[a[i]] == 0)) {
      min = i - 1;
      for (j = 0; j < i; j++) {
        int h = 0;
        if ((a[j] != a[i]) && (ar[a[j]] != 0)) {
          for (f = (n - 1); f > i; f--) {
            if (a[j] == a[f]) {
              occ = f;
              h = 1;
            }
          }
          if (h == 0) {
            mn = a[j];
            break;
          }
          if (occ > min) {
            min = occ;
            mn = a[occ];
          }
        }
      }
      ar[mn]--;
      if (ar[mn] == 0) s.erase(mn);
    }
    if (ar[a[i]] == 0) {
      s.insert(a[i]);
      b++;
      ar[a[i]]++;
    }
    c[a[i]]--;
  }
  cout << b;
  return 0;
}
