//#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<vector>
#include <algorithm>
using namespace std;

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
//#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
const int N = 1e6;
void rohan_algo()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}







int32_t main()
{
	rohan_algo();
	int n, x;
	string s;
	cin >> n >> x; cin >> s;
	int k = 0;
	for (int i = 0; i < n; ++i)
	{
		if (s[i] == 'x' && x != 0) {
			x--;
		} else if (s[i] == 'o')
			x++;

	}
	cout << x << endl;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,x;
	scanf("%d %d",&n,&x);
	char S[n+1];
	scanf("%s",S);
	for(int i=0;i<n;i++){
		if(S[i]=='o')x++;
		else x--;
		x=max(0,x);
	}
	printf("%d\n",x);
	return 0;
}