#include <bits/stdc++.h>
using namespace std;
const int maxn = 85;
const int INF = 0x3f3f3f3f;
int vis[maxn];
int num[maxn];
int nxt[maxn];
int a[maxn];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    num[a[i]]++;
  }
  int ans = 0;
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    num[a[i]]--;
    if (vis[a[i]] == 0) {
      ans++;
      if (cnt < k) {
        cnt++;
      } else {
        int index = 0;
        for (int j = 1; j < i; j++) {
          if (vis[a[j]] == 1 && num[a[j]] == 0) {
            index = a[j];
            break;
          }
        }
        if (index == 0) {
          memset(nxt, 0, sizeof(nxt));
          for (int j = i + 1; j <= n; j++) {
            if (vis[a[j]] == 1 && nxt[a[j]] == 0) {
              index = a[j];
              nxt[a[j]] = 1;
            }
          }
        }
        vis[index] = 0;
      }
      vis[a[i]] = 1;
    }
  }
  printf("%d\n", ans);
  return 0;
}
