#include #define rep(i,n) for(int i = 0;i> n; string s; cin >> s; int ans = 0; bool bx = false; rep(i,n-1){ if(bx and s[i+1] == 'B') continue; bx = s[i] =='B'; ans++; } cout << ans << endl; return 0; }