import copy

n=int(input())
stemp=input()
s=[ i for i in stemp]

s2=copy.copy(s)
ans=0
ans2=0
for i in range(n):
    #print(i)
    if i<=n-2:
        if s[i] == "#" and s[i+1]==".":
            s[i+1]="#"
            ans+=1
    if 1<=i:
        if s2[i]=="." and s2[i-1]== "#":
            s2[i-1]="."
            ans2+=1

#print(s)
#print(s2)
#print(ans,ans2)
print(min(ans,ans2))