#include using namespace std; using ll = long long; #define rep(i,n) for(int i=0;i<(int)(n);i++) int main(){ int n,m; string s; cin>>n>>m>>s; vector> vp; int ans=0; { char bf=s.at(0); int nm=0; for(char c:s){ if(c=='o') ans++; if(bf==c) nm++; else{ vp.push_back({bf,nm}); bf=c; nm=1; } } vp.push_back({bf,nm}); } vector> vv; rep(i,vp.size()){ if(vp.at(i).first=='-'){ int ct=0; if(vp.at(i-1).first=='o') ct++; if(vp.at(i+1).first=='o') ct++; if(ct==2&&vp.at(i).second==1){ ans++; continue; } vv.push_back({ct,vp.at(i).second}); } } sort(vv.begin(),vv.end(),[&](auto p,auto q){ auto[a,x]=p; auto[b,y]=q; if(a==2&&b==2){ if(x%2==1&&y%2==1){ return xy%2; } return a>b; }); int tef=0; for(auto[t,nm]:vv){ if(t==2){ while(m&&nm>=2){ m--; ans+=2; nm-=2; } if(nm) ans++; }else if(t==1){ while(m&&nm>=2){ m--; ans+=2; nm-=2; } if(nm) tef++; }else{ if(m){ m--; ans++; nm--; while(m&&nm>=2){ m--; ans+=2; nm-=2; } if(nm) tef++; } } } ans+=min(tef,m); cout<