#include <bits/stdc++.h>
using namespace std;
vector<int> have;
int check[100];
int m[100];
int n, k;
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> m[i];
  }
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    if (have.size() < k) {
      if (check[m[i]] == 0) {
        sum++;
        check[m[i]] = 1;
        have.push_back(m[i]);
      }
    } else {
      int cook = 0;
      for (int j = 0; j < k; j++) {
        if (have[j] == m[i]) {
          cook = 1;
          break;
        }
      }
      if (cook) continue;
      int _min = 0, id;
      int okk = 0;
      sum++;
      for (int j = 0; j < k; j++) {
        bool ok = 0;
        for (int ij = i + 1; ij <= n; ij++) {
          if (m[ij] == have[j]) {
            if (_min < ij) {
              _min = ij;
              id = j;
            }
            ok = 1;
            break;
          }
        }
        if (ok == 0) {
          okk = 1;
          have[j] = m[i];
          break;
        }
      }
      if (okk)
        continue;
      else
        have[id] = m[i];
    }
  }
  cout << sum;
}
