n=int(input())
s=list(input())
sw=s
t=0
k=0
for i in range(n-1):
    if s[i+1]==".":
        if s[i]=="#":
            t+=1
            s[i+1]="#"

for i in range(n-1):
    if sw[i]=="#":
        if sw[i+1]==".":
            k+=1
            sw[i+1]="#"
print(max(t,k))