n=int(input())
s=input()
count1=0
count2=0
for i in range(n-1):
    if(s[i]=='#'):
        if(s[i+1]=='.'):
            count1+=1
        else:
            continue
    else:
        continue
for j in range(n-1):
    if(s[i]=='.'):
        if(s[i+1]=='#'):
            count2+=1
        else:
            continue
    else:
        continue
print(min(count1,count2))