#include <bits/stdc++.h>
#define endl '\n';

typedef long long ll;

using namespace std;

const int maxn = 1e5 + 10;

int main()
{
	ios::sync_with_stdio(false);
	int n,x;
	char aws;
	cin >> n >> x;
	for (int i = 0; i < n; i++) {
		cin >> aws;
		if (aws == 'o')x++;
		else if (x != 0) x--;
	}
	cout << x << endl;
	return 0;
}
// B - Quizzes
#include <bits/stdc++.h>
using namespace std;

int main(){
	int n, x; string s; cin>>n>>x>>s;
	for(auto c:s) x = c=='o'? x+1:max(0, x-1);
	cout<< x <<endl;
}
