#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mod 1000000007
main()
{
    int n,x,i,j;
    cin>>n>>x;
    char s[n+1];
    cin>>s;
    for(i=0;i<n;i++)
    {
        if(s[i]=='o')
        {
            x++;
        }
        else
        {
            x--;x=max(x,0);
        }
    }
    cout<<x<<endl;
}

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)

int main() {
  int N, X;
  string S;
  cin >> N >> X >> S;
  
  int point = X;
  rep (i, N) {
    if (S.at(i) == 'o')
      point++;
    else
      point = max(0, point-1);
  }
  
  cout << point << endl;
}