#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <algorithm>
using namespace std;

template <typename Tp> inline void getint(Tp &num){
	register int ch, neg = 0;
	while(!isdigit(ch = getchar())) if(ch == '-') neg = 1;
	num = ch & 15;
	while(isdigit(ch = getchar())) num = num * 10 + (ch & 15);
	if(neg) num = -num;
}

int N, K;

int main(){
	getint(N), getint(K);
	return printf("%d\n", N - K + 1), 0;
}

#include<bits/stdc++.h>
using namespace std;
using ll = long long;


int main(){
    int n; cin>> n;
    vector<ll> a(100000);
    set<ll> memo;
    
    for(int i=0; i<n; i++){
        cin >> a[i];
        if(memo.count(a[i])){
            memo.erase(a[i]);
        }else{
            memo.insert(a[i]);
        }
    }
    int ans = memo.size();
    cout << ans << endl;
    return 0;
}