#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define pii pair<int,int>
#define vi vector<int>
#define vpii vector<pii>
#define pll pair<ll,ll>
#define vll vector<long long>
#define f first
#define s second
long long mod = 1e9+7;
typedef vector<map<char,int>> vmci;

int diry[] = {-1,-1,-1,0,0,1,1,1};
int dirx[] = {-1,0,1,-1,1,-1,0,1};

ll pow(ll x, ll y, ll p) {
    ll res = 1;
    x %= p;
    if(x == 0) {
        return 0;
    }
    while(y > 0) {
        if(y & 1) {
            res = (res * x) % p;
        }
        y >>= 1;
        x = (x * x) % p;
    }
    return res;
}

long long int power(int base, int exp)
{
    if (exp == 0)
       return 1;
    else if (exp == 1)
       return base;
    else
    {
       long long int calc;
       if (exp % 2 == 0)
       {
         calc = power(base, exp/2);
         calc *= calc;
       }
       else
       {
         calc = base*power(base, exp-1);
       }
       return calc;
    }
}

void seg_sieve(ll max,ll arr[]){
    ll i,j;
    for(i=2;i*i<=max;i++){
        if(arr[i]==0){
            for(j=i*i;j<=max;j+=i)
                arr[j]=1;
        }
    }
}

float distance(int x,int y,int a,int b){
    return sqrt(pow(x-a,2) + pow(y-b,2));
}

struct noob{
    int l,r,ind;
    noob(){
        l=-1,r=-1,ind=-1;
    }
    noob(int a,int b,int c){
        l=a,r=b,ind=c;
    }
};

bool comp1(noob &a,noob &b){
    return a.l<b.l;
}
bool comp2(pll &a,pll &b){
    return a.first>b.first;
}
bool isPrime(ll n) 
{ 
    // Corner cases 
    if (n <= 1) 
        return false; 
    if (n <= 3) 
        return true; 

    if (n % 2 == 0 || n % 3 == 0) 
        return false; 
  
    for (ll i = 5; i * i <= n; i = i + 6) 
        if (n % i == 0 || n % (i + 2) == 0) 
            return false; 
  
    return true; 
} 
  
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t=1;      
    // cin>>t; 
    int ulti=1;           
    while(t--){                
        int n,x; cin>>n>>x;
        string arr; cin>>arr;
        for(int i=0;i<n;i++){
            if(arr[i]=='x' and x>0) x--;
            else if(arr[i]=='o') x++;
        }
        cout<<x;
    }
    
}
#include <iostream>
#include <string.h>
using namespace std;

int main()
{
	int size, intial = 0;
	char s;
	cin >> size >> intial;
	for (int i = 0;i < size;i++)
	{
		cin >> s;
		if (s == 'o')
		{
			intial++;
		}
		else if (s == 'x')
		{
			if (intial != 0)
			{
				intial--;
			}
		}
	}
	cout << intial << endl;
	return 0;
}

