#include<bits/stdc++.h>
using namespace std;
int main(){

long long n,x;
cin>>n>>x;



string s;
cin>>s;
int m= s.length();
for(int i=0; i<m;++i){
	if(x==0 && s[i]== 'x'){	
		x+=0;
	}
		else if (s[i]== 'x'){	
			x--;
		}
		else{
			x++;
		}

	}
cout<<x;

}

#include<cstdio>
inline int in();
inline void wr(int);
inline int mx(int,int);
int main(int argc,char**argv){
	register int n=in(),x=in();
	while(n--){
		register char c=getchar();
		while(c!='o'&&c!='x')c=getchar();
		if(c=='x')x=mx(0,x-1);
		else ++x;
	}
	wr(x),putchar('\n');
}
inline int mx(int x,int y){
	return x>y?x:y;
}
inline int in(){
	register char c=getchar();
	register int x=0,f=1;
	for(;c<'0'||c>'9';c=getchar())
		if(c=='-')f=-1;
	for(;c>='0'&&c<='9';c=getchar())
		x=(x<<1)+(x<<3)+(c&15);
	return x*f;
}
inline void wr(int x){
	if(x<0)putchar('-'),x=-x;
	if(x/10)wr(x/10);
	putchar(x%10+'0');
}