#include using namespace std; using ll = long long; #define rep(i,m,n) for(int i=m; i> N >> S; set st; rep(i, 0, N-1){ string T = S; T[i] = 'B'; T[i+1] = 'B'; st.insert(T); } cout << st.size() << endl; return 0; }