#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll n,x,c;
cin>>n>>x;
int a[n];vector<int>b;
cin>>a[0];int t=1;
for(int i=i;i<n;i++){cin>>a[i];if(a[i]!=a[i-1]){t++;}else{b.push_back(t);t=1;}}
int ans=0;
for(auto i=b.begin();i<b.end();i++){
ans+=(b[distance(b.begin(),i)]+x-1)/x;
}cout<<ans;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgbGwgbG9uZyBsb25nCiAKaW50IG1haW4oKSB7CmxsIG4seCxjOwpjaW4+Pm4+Png7CmludCBhW25dO3ZlY3RvcjxpbnQ+YjsKY2luPj5hWzBdO2ludCB0PTE7CmZvcihpbnQgaT1pO2k8bjtpKyspe2Npbj4+YVtpXTtpZihhW2ldIT1hW2ktMV0pe3QrKzt9ZWxzZXtiLnB1c2hfYmFjayh0KTt0PTE7fX0KaW50IGFucz0wOwpmb3IoYXV0byBpPWIuYmVnaW4oKTtpPGIuZW5kKCk7aSsrKXsKCWFucys9KGJbZGlzdGFuY2UoYi5iZWdpbigpLGkpXSt4LTEpL3g7Cn1jb3V0PDxhbnM7CglyZXR1cm4gMDsKfQ==