#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double EPS = 1e-6;
const long long oo = 1LL << 60;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const int N = 105;
int a[N], vis[N];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; ++i) cin >> a[i];
  int ans = 0, cnt = 0;
  for (int i = 0; i < n; ++i) {
    if (!vis[a[i]]) {
      cnt++;
      ans++;
      if (cnt > k) {
        int idx = -1, pos = -1;
        for (int j = 1; j < n + 1; ++j) {
          if (vis[j]) {
            int p = n;
            for (int o = n - 1; o >= i + 1; --o)
              if (a[o] == j) p = o;
            if (p > pos) {
              pos = p;
              idx = j;
            }
          }
        }
        vis[idx] = 0;
        cnt--;
      }
      vis[a[i]] = 1;
    }
  }
  cout << ans << endl;
  return 0;
}
