#include <bits/stdc++.h>
using namespace std;

int main() {
  long long N, X;
  //string S;
  
  cin >> N >> X;
  
  long long ans = X;
  for(int i=0; i<N; i++){
    char c;
    cin >> c;
    if(c=='o'){
      ans++;
    }else{
      if(ans>0) ans--;
    }
  }
  
  cout << ans << endl;
  return 0;
}

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
#define All(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()   //reverse
#define strall(v) (v).cbegin(),(v).cend() //const_itterator
#define IN(a, b, x) (a<=x&&x<b)
using namespace std;
using ll = long long;
using Pair = pair<int,int>;
using Graph = vector<vector<ll>>;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
template<typename t, typename u, typename Comp=less<>>
bool chmax(t& xmax, const u& x, Comp comp={}) { if(comp(xmax, x)) { xmax = x; return true; } return false;}
template<typename t, typename u, typename Comp=less<>>
bool chmin(t& xmin, const u& x, Comp comp={}) { if(comp(x, xmin)) { xmin = x; return true;} return false;}
const int INF = 1e9;
const ll infl = ll(1e18)+5;

int main(){
 ll N,x;
 string s;
 int cnt1=0,cnt2=0;
 cin >> N >> x >> s;
 for(int i=0;i<s.size();i++){
   if(s[i] == 'o') x++;
   else{
       if(x == 0) continue;
       x--;
   }
 }
 cout << x << endl;
}
