#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
int main(){
  int n,x;
  cin >> n >> x;
  string s;
  cin >> s;
  rep(i,n){
    if(s.at(i) == 'o') x += 1;
    if(s.at(i) == 'x'){
      if(x != 0) x -= 1;
      else continue;
    }
  }
  cout << x << endl;
  return 0;
}
  
#include <bits/stdc++.h>
#define llong long long
#define INF 999999999
using namespace std;

int main()
{
    int N, X;
    string S;
    cin >> N >> X >> S;
    for (int i = 0; i < N; i++)
    {
        if (S[i] == 'o')
            X++;
        else
        {
            if (X > 0)
                X--;
        }
    }
    cout << X;
}