#include <bits/stdc++.h>
int main() {
  int n, k;
  int a[80];
  int cost = 0;
  std::set<int> book;
  std::cin >> n >> k;
  for (int i = 0; i < n; ++i) {
    int temp;
    std::cin >> temp;
    a[i] = temp;
  }
  for (int i = 0; i < n; ++i) {
    if (book.find(a[i]) == book.end()) {
      if (book.size() < k) {
        book.insert(a[i]);
        ++cost;
      } else {
        int cur = i;
        int value = -1;
        std::set<int>::iterator itr;
        for (itr = book.begin(); itr != book.end(); ++itr) {
          int cur_pos = i;
          for (int j = i + 1; j < n; ++j) {
            if (*itr == a[j]) {
              cur_pos = j;
              break;
            }
          }
          if (cur_pos == i) {
            value = *itr;
            break;
          } else if (cur_pos > cur) {
            cur = cur_pos;
            value = *itr;
          }
        }
        book.erase(value);
        book.insert(a[i]);
        ++cost;
      }
    }
  }
  std::cout << cost;
  return 0;
}
