import std; void main() { int N; readf("%d\n", N); auto S = readln.chomp.to!(dchar[]); int[string] list; foreach (i; 1 .. N) { dchar F = S[i-1], B = S[i]; S[i-1] = 'B', S[i] = 'B'; ++list[S.to!string]; S[i-1] = F, S[i] = B; } auto res = list.length; res.writeln; }