input() S=input() C=set() for i in range(len(S)-1): m=S[:i]+"BB"+S[i+2:] if m in C : pass else: C.add(m) print(len(set(C)))