#include<iostream>
using namespace std;
int main()
{
    string s;
	int n,m;
	cin>>n>>m>>s;
	for(int i=0;i<s.size();i++)
	{
		if(s[i]=='x'&&m!=0)
		{
			m--;
		}
		else if(s[i]=='o')
		{
			m++;
		}
	}
	cout<<m;
  return 0;
}
//This Code was made by Chinese_zjc_.
#include <iostream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <bitset>
#include <cmath>
#include <queue>
#include <stack>
#include <list>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <map>
#include <set>
#include <ctime>
// #include<windows.h>
// #define debug true
#define int long long
#define double long double
using namespace std;
const double PI = acos(-1);
const double eps = 0.0000000001;
const int INF = 0x3fffffffffffffff;
int n, x;
char c;
signed main()
{
    ios::sync_with_stdio(false);
    cin >> n >> x;
    for (int i = 1; i <= n; ++i)
    {
        cin >> c;
        if (c == 'o')
        {
            ++x;
        }
        else
        {
            x = max(x - 1, 0ll);
        }
    }
    cout << x << endl;
    return 0;
}