//Adarsh
//IIIT Gwalior
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define REP(i,n) for(int i=1;i<=(int)n;i++)
#define FAST_IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
#define pb push_back
#define vi vector<int> 
#define initial(a, x) memset(a, x, sizeof(a))
void solve() {
   ll n,x;
   string s;
   cin>>n>>x>>s;
   rep(i,n){
       if(s[i]=='o') x++;
       else{
           if(x>0) x--;
       }
   }
   cout<<x;
}
int main() {
    FAST_IO
   // int tc; 
   // cin >> tc;
    //for (int t = 1; t <= tc; t++) {
        // cout << "Case #" << t  << ": ";
        solve();
    //}
}
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

int main() {
  int n, x;
  cin >> n >> x;
  string s;
  cin >> s;
  int ans = x;
  rep(i, n) {
    if (s[i] == 'o')
      ++ans;
    else
      ans = max(0, ans - 1);
  }
  cout << ans << endl;
  return 0;
}
