#pragma GCC optimise ("O1")
#include<bits/stdc++.h>
using namespace std;
#define ll           long long
#define rep(i,j,n)   for(ll i=j;i<n;i++)
#define _rep(i,n)   for(ll i=n-1;i>=0;i--)
#define scn(a)       scanf("%lld",&a)
#define scns(a,b)    scanf("%lld %lld",&a,&b)
#define print(a)     printf("%lld ",a)
#define vec          vector<ll>
#define pb           push_back    
#define pairs        pair<ll,ll>
#define f            first
#define s            second
#define all(v)       v.begin(),v.end()
#define srt(v)       sort(v.begin(),v.end())
#define read(a)       for(auto &it:a) cin>>it;
#define write(a)      for(auto it:a) cout<<it<<" ";
#define yeS(GOOD)      GOOD ? cout<<"YES\n" : cout<<"NO\n"
#define mem(a,b)     memset(a,b,sizeof(a))
#define nl           printf("\n")
#define inf          1e9
#define zer          INT_MIN
#define fast         ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
const int N=2e5 + 5;

ll n;

int main()
{
  // fast;
  int t1=1; 
  // cin>>t1;
  while(t1--)
  {
    ll n,x; scns(n,x);
    string s; cin>>s;

    for(auto it:s)
    {
      if(it=='o')
      ++x;
      else
      {
        x=max(0LL,--x);
      }
    }
     cout<<x;
  }
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
	long int n,x;
	cin>>n>>x;
	string s;
	cin>>s;
	for(int i=0;i<s.length();i++)
	{
		if(s[i]=='o')
		x++;
		else if(s[i]=='x')
		{
			if(x==0)
			{
				continue;
			}
			else
			x--;
		}
	}
	cout<<x<<endl;
}