#include <bits/stdc++.h>
using namespace std;
int arr[88], dp[88];
int main(void) {
  int n, k, rr = 0, tot = 0;
  cin >> n >> k;
  for (int e = 0; e < n; e++) cin >> arr[e];
  for (int e = 0; e < n; e++) {
    if (dp[arr[e]]) continue;
    if (tot < k) {
      rr++;
      tot++;
      dp[arr[e]] = 1;
    } else {
      int maxs = -1, wh;
      for (int p = 0; p < 88; p++) {
        if (dp[p] == 1) {
          int rrr = -1;
          for (int q = e + 1; q < n; q++) {
            if (arr[q] == p) {
              rrr = q;
              break;
            }
          }
          if (rrr == -1) rrr = n;
          if (rrr > maxs) {
            maxs = rrr;
            wh = p;
          }
        }
      }
      dp[wh] = 0;
      dp[arr[e]] = 1;
      rr++;
    }
  }
  cout << rr;
}
