//compiledef
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0;i<(n);i++)
#define per(i, n) for(int i=(n);i>0;i--)
#define repx(i, n, x) for(int i=(x);i<(n);i++)
#define xper(i, n, x) for(int i=(n);i>(x);i--)
#define pback push_back

//c++def
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
const ll MOD = 1e9+7;
const ll MOD2 = 998244353;

int main(){
	int n, x;
	char buf;
	cin >>  n >> x;

	rep(i, n){
		cin >> buf;
		if(buf =='o')++x;
		else if(x <=0);
		else --x;
	}
	cout <<  x << endl;
}

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<iomanip>
using namespace std;

int main(void){
    int N, X;
    cin >> N >> X;
    string S;
    cin >> S;

    int ans = X;
    for(int i=0;i<N;i++){
        if(S[i] == 'o') ans++;
        else{
            if(ans != 0) ans--;
        }
    }

    cout << ans << endl;
}