#include <bits/stdc++.h>
using namespace std;
int arr[85];
int main() {
  int n, k, cnt = 0, tmp = 0;
  cin >> n >> k;
  vector<int> a(n), v;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    if (v.size() != k && find(v.begin(), v.end(), a[i]) == v.end()) {
      v.push_back(a[i]);
      cnt++;
    } else if (v.size() == k && find(v.begin(), v.end(), a[i]) == v.end()) {
      vector<int> save;
      for (int j = i; j < n; j++) {
        if (find(v.begin(), v.end(), a[j]) != v.end()) {
          if (find(save.begin(), save.end(), a[j]) == save.end())
            save.insert(save.begin(), a[j]);
        }
      }
      if (save.size() == k)
        v.erase(find(v.begin(), v.end(), *save.begin()));
      else if (save.size() > 1 && save.size() < k) {
        for (int i = 0; i < v.size(); i++) {
          if (find(save.begin(), save.end(), v[i]) == save.end())
            v.erase(find(v.begin(), v.end(), v[i]));
        }
      } else if (save.size() == 1 && k == 1)
        v.erase(v.begin());
      else {
        for (int i = 0; i < v.size(); i++) {
          if (find(save.begin(), save.end(), v[i]) == save.end())
            v.erase(find(v.begin(), v.end(), v[i]));
        }
      }
      v.push_back(a[i]);
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}
