#pragma region おまじないα ver1.02
//#define _CRT_SECURE_NO_WARNINGS
//#pragma warning(disable : 4996)
//#define int long long;
#pragma region 変化しないおまじない

#include "bits/stdc++.h"
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")


typedef long long ll;
#define all(x) (x).begin(), (x).end()  // sortなどの引数を省略
#define max3(x, y, z) max(x, max(y, z))
#define min3(x, y, z) min(x, min(y, z))

#define rep(i,n) repi(i,0,n)
#define reps(i,n) repi(i,1,n+1)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);i++)

//typedef pair<ll, ll> P;
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back

#ifdef _MSC_FULL_VER  //デバッグ出力
#define dout cout
#define debug() if (true)
#define check(x) std::cout << "★" << #x << "の値:" << (x) << endl
#define pass(x) std::cout << "☆" << x << endl
#else
#define dout \
  if (false) cout
#define debug() if (false)
#define check(x) \
  if (false) cout << "★" << #x << "の値:" << (x) << endl
#define pass(x) \
  if (false) cout << "☆" << x << endl
#endif
using namespace std;

double dist(double x1, double y1, double x2, double y2) {
  return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
ll idist(ll x1, ll y1, ll x2, ll y2) {
  return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
}
struct qwqw{
  qwqw() {
    cin.tie(0); cout.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(20);
  };
}aaaaaaa;
#pragma endregion
#pragma endregion
signed main() {
  string s;
  ll n, x;
  cin >> n >> x >> s;
  rep(i, n) {
    if (s[i] == 'o') {
      x++;
    } else {
      x--;
      x = max(x, (ll)0);
    }
  }
  cout << x;
}
#include<bits/stdc++.h>
using namespace std;

int main(){ 
  int n,x;
  string s;
  cin >> n >> x >> s;
  for(int i=0; i<n; i++){
    if(s[i]=='x'){
      if(x>0) x--;
    }
    else x++;
  }
  cout << x << endl;
}