#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using pii = pair<int, int>;

int main() {
  int n, x;
  cin >> n >> x;
  string s;
  cin >> s;
  for (int i = 0; i < n; i++) {
    x += s[i] == 'o' ? 1 : -1;
    x = max(x, 0);
  }
  cout << x << endl;
}
#include<bits/stdc++.h>
#define cases long long test;cin>>test;while(test--)
#define f_io ios::sync_with_stdio(false); cin.tie(0)
#define foi(a,n) for(long long i=a;i<n;i++)
#define foj(a,n) for(long long j=a;j<n;j++)
#define fok(a,n) for(long long k=a;k<n;k++)
#define ll long long
#define MOD 1000000007
#define INF 1000000000
using namespace std;

int main()
{
    f_io;
    ll n,x;
    cin >> n >> x;
    string s;
    cin >> s;
    foi(0,n)
    {
        if(s[i]=='o')
            x++;
        else
        {
            if(x)
                x--;
        }
    }
    cout << x;
    return 0;
}