266A - Stones on the Table
123456789101112131415
def colored_stones(num, colors):
count = 0
for i in range(0, len(colors) - 1):
if colors[i] == colors[i+1]:
count += 1
else:
continue
return count
if __name__ == '__main__':
num = int(input())
colors = input()
print(colored_stones(num, colors))
Python
INFO