N=int(input())
S=input()
count1=0
count2=0
s=list(S)

for i in range(N-1):
    if s[i]!=s[i+1]:
        s[i+1]=s[i]
        count1+=1
        
for i in range(N-1):
    if s[i]!=s[i+1]:
        s[i]=s[i+1]
        count2+=1

if count1<count2:
    print(count2)
else:
    print(count1)