#include <bits/stdc++.h>
#define lol long long
#define INF 998244353
using namespace std;
int main(){
    int a,b;
    char c;
    cin>>a>>b;
    for(int i=0;i<a;i++){
        cin>>c;
        if(c=='o') b++;
        else if(b!=0) b--;
    }
    cout<<b<<"\n";
    return(0);
}
#include <bits/stdc++.h>
#define f(a, n) for (int a = 0; a < n; a++)
#define F(a, n) for (int a = 1; a <= n; a++)

using namespace std;

int main(){
	int n, x;
	string s;
	cin>>n>>x>>s;
	f(i, n){
		if (s[i] == 'o'){
			x++;
		}
		else{
			if (x > 0) x--;
		}
	}
	cout<<x<<endl;
}