#include <iostream>
using namespace std;
int main(){
int h,s;
string str;
cin>>h>>s>>str;
for(int i=0;i<str.size();i++){
if(str[i]=='u'){
if(s>0){
s--;
}
}else{
if(s<h){
s++;
}
}
}
cout<<s;
}
/**************************************************************
Problem: 1826
User: wangyiyang
Language: C++
Result: Accepted
Time:49 ms
Memory:2076 kb
****************************************************************/