#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 9;
const int mod = 1e9 + 7;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
int t;
t = 1;
while(t--){
int n , k;
cin >> n >> k;
k--;
int arr[n];
for(int i = 0; i < n; i++) cin >> arr[i];
sort(arr, arr + n);
int ans = k + 1;
for(int i = 1; i <= k; i++){
if(arr[i] == arr[i - 1]) ans++;
}
cout << ans << "\n";
}
return 0;
}