#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define endl "\n"
#define debug(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

// const ll mod = 1e9 + 7;
const ll mod = 998244353;
const ll sz = 1e6 + 5;
vector<ll> fac(sz, 1);
vector<bool> prime(sz, true);
vector<ll> fib(sz, 0);

ll powmod(ll a, ll b) { ll res=1; a%=mod; assert(b>=0); for(;b;b>>=1) { if(b&1) res=res*a%mod; a=a*a%mod; } return res; }
ll nCr(ll n, ll r) { return ( ( ( (fac[n] * powmod(fac[n-r], mod-2)) % mod ) * powmod(fac[r], mod-2) ) % mod ); }
ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a; }
ll lcm(ll a, ll b) { return (a / gcd(a,b)) * b; }

// * Always PASS arrays, strings etc to functions BY REFERENCE

void solve() {
    ll n, x;
    cin >> n >> x;
    
    string s;
    cin >> s;
    
    for (auto c: s) {
        if (c == 'o')
            x += 1;
        else
            x = max(0ll, x-1);
    }
    
    cout << x << endl;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
//     fib[1] = 1;
//     for (int i = 2; i < sz; i++)
//         fib[i] = (fib[i-1] + fib[i-2]) % mod;
    
//     for (ll i = 2; i < sz; i++)
//         fac[i] = (fac[i-1] * i) % mod;
    
//     prime[0] = prime[1] = false;
//     for (ll i = 2; i*i < sz; i++) {
//         if (!prime[i])
//             continue;
        
//         for (ll j = i*i; j < sz; j += i)
//             prime[j] = false;
//     }
    
    int t = 1;
    // cin >> t;
    
    while(t--) {
        solve();
    }
    
	return 0;
}
#include <bits/stdc++.h>

using namespace std;



signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);

  int n, x;
  string s;
  cin >> n >> x >> s;
  for (auto &c : s) {
    if (c == 'o') {
      x++;
    } else {
      x--;
    }
    if (x < 0) {
      x = 0;
    }
  }
  cout << x << "\n";
}
