import copy n=int(input()) a=list(input()) s=set([]) for i in range(1,n): b=copy.copy(a) b[i-1]="B" b[i]="B" s.add("".join(b)) print(len(s))