#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; #define sz size() #define pb push_back #define mp make_pair #define fi first #define se second #define all(c) (c).begin(), (c).end() #define rep(i,a,b) for(ll i=(a);i<(b);++i) #define per(i,a,b) for(ll i=(b-1);i>=(a);--i) #define clr(a, b) memset((a), (b) ,sizeof(a)) #define ctos(c) string(1,c) #define print(x) cout<<#x<<" = "<>n>>k; vector v; rep(i,0,n){ ll a; cin>>a; a--; v.pb(a); } ll c = 0; priority_queue, greater > q; rep(i,0,n){ if(v[i]==i)continue; else if(v[i]>i){ q.push(v[i]); c++; } else{ ll a = q.top(); if(a!=i){ c++; } else{ q.pop(); } } } if(k