#include <stdio.h>
#include<algorithm>
#include <math.h>
#include<iostream>
#include <stack>
#include<string.h>
#include<vector>
using namespace std;
int main()
{
	long long int n,x;
	string a;
	cin>>n>>x;
	cin>>a;
//	scanf("%s",a);
	for( int i=0;i<n;i++){
		if(a[i]=='o'){
			x++;
		}
		else {
			if(x>0){
				x--;
			}
		}
	}
	cout<<x;
	
	
		
}

#include<bits/stdc++.h>
/*#include<boost/multiprecision/cpp_int.hpp>
using boost :: multiprecision::cpp_int;*/
#define ll long long int
#define mod 1000007
using namespace std;
/*int gcd(int a, int b)
{
  if (a == 0)
    return b;
  return gcd(b % a, a);
}*/

void solve()
{
  char s[3];
  char k;
  cin >> s;
  k = s[0];
  for (int i = 0; i < 2; i++)
  {
    s[i] = s[i + 1];
  }
  s[2] = k;
  for (int i = 0; i < 3; i++)
  {
    cout << s[i];
  }
}
int main()
{


  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();

  return 0;

}


