#include using namespace std; int main() { int N; string S; cin >> N >> S; int ans = 1; for(int i = 0; i+1 < N; i++) { if(S[i] == 'B' && S[i+1] == 'B') { continue; } else { ans++; } } cout << ans << endl; }