#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main()
{
    int n, x;
    string s;
    cin >> n >> x;
    cin >> s;
    int cnt=x;
    for(int i=0; i<s.size(); i++)
    {
        if(s[i]=='x' && cnt>0)cnt--;
        else if(s[i]=='o')cnt++;
    }
    cout << cnt;
}

#include <bits/stdc++.h>
//#include "/home/amal/basic.h"
using namespace std;
#define ll long long
#define boost 	ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define loop(i,n) for(ll i=0;i<n;i++)
#define tc() int t;cin>>t;while(t--)
int main()
{
	boost
	#ifndef Amal 
	//	freopen("/home/amal/Desktop/programming/c++/practise/input_test1.txt","r",stdin); 
			//freopen("/home/amal/Desktop/programming/c++/practise/output_test1.txt","w",stdout); 
	#endif
			int n,x;
			cin>>n>>x;
			string s;
			cin>>s;

			int mark=x;

			for(int i=0;i<n;i++)
			{
				//cout<<mark<<" ";
				if(s[i]=='o')
					mark++;
				else if(s[i]=='x')
				{
					if(mark>0)
						mark--;
				}
			}

			cout<<mark;
}
