n = read_line.to_i s = read_line sc = s.chars set = Set(Array(Char)).new i = 0 (n-1).times do |i| c1 = sc[i] c2 = sc[i+1] sc[i] = 'B' sc[i+1] = 'B' set << sc sc[i] = c1 sc[i+1] = c2 i += 1 end puts set.size