N = int(input()) S = list(input()) ans = set() for i in range(1,N): X = S.copy() X[i] = 'B' X[i-1] = 'B' ans.add(''.join(X)) print(len(ans))