#include <bits/stdc++.h>
using namespace std;
int main() {
   int64_t n,x; cin >> n >> x;
   string s; cin >> s;
   for(char c : s){
     if(c=='o')x++;
     if(c=='x'&&x>0)x--;
   }
   cout<<x<<"\n";
}
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
#define pb push_back
#define mpr make_pair
#define pii pair<int, int>
#define ll long long
#define dl long double
#define all(arr) arr.begin(), arr.end()
#define fi first
#define se second
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define pie 3.14159265358979323846264338327950L
#define mid(l, r) l + (r - l) / 2
#define vec vector<int>
#define yes cout << "YES" << endl;
#define no cout << "NO" << endl;
#define endl "\n"
#define int long long
#define sz(x) (int)x.size()
#define template_array_size (int)1e6 + 6
#define INF (int)1e18
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
using namespace std;

int gcd(int a,int b){ if(!a)return b;return gcd(b%a,a);}
int lcm(int a, int b) { return (a*b)/ gcd(a,b);}


const int MOD = 1e9 + 7;
const int mod = 1e9 + 7;


void sout(){
	cout<<endl;
}
template <typename T,typename... Types>
void sout(T var1,Types... var2){
	cout<<var1<<" ";
	sout(var2...);
}
template<typename T>
void sout(vector<T> arr) {
    for(auto it : arr) {
        cout<<it<<" ";
    }
    sout();
}


// int n,m;
// int temp;
// int cnt;
// int ans;
// int ind;  
// int i,j;
// int a,b;



// vector<int> arr;
// vector<int> brr;
// int k;















void test_case () {

    

   


    int n, x;
    cin>>n>>x;

    string s;
    cin>>s;

    for(auto it : s) {
        if(it == 'o') {
            x++;
        } else {
            x--;
        }
        x = max(x, 0*1ll);
    }

    cout<<x;
       



}

















int32_t main ()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cout << fixed << setprecision(10);

    #ifndef ONLINE_JUDGE    
        freopen("input.txt","r",stdin);
        // freopen("output.txt","w",stdout); 
    #endif

    int t = 1;
    // cin >> t;
    while (t--)
    {
        test_case();
    }

    cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
}


/* stuff you should look for
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* WRITE STUFF DOWN
	* DON'T GET STUCK ON ONE APPROACH
*/