#include // clang-format off using namespace std; using ll=long long; using ull=unsigned long long; using pll=pair; const ll INF=4e18; void print0(){}; template void print0(H h,T... t){cout<void print(H h,T... t){print0(h);if(sizeof...(T)>0)print0(" ");print(t...);} void perr0(){}; template void perr0(H h,T... t){cerr<void perr(H h,T... t){perr0(h);if(sizeof...(T)>0)perr0(" ");perr(t...);} void ioinit() { cout<> N; string S; cin >> S; set changed; bool nochange = false; for (ll i = 0; i < N - 1; i++) { bool cur = (S[i] == 'A'); bool nxt = (S[i + 1] == 'A'); if (cur && nxt) { changed.insert({i, i + 1}); } if (cur && !nxt) { changed.insert({i, i}); } if (!cur && nxt) { changed.insert({i + 1, i + 1}); } if (!cur && !nxt) { nochange = true; } } ll ans = changed.size(); if (nochange) ans++; print(ans); return 0; }