n=int(input())
s=list(input())
ss=tuple(s)
h=0
for i in range(n-1):
    if s[i]=="#" and s[i+1]==".":
        h+=1
        s[i+1]="#"
b=0
ss=list(ss)
for i in range(n-1,0,-1):
    if ss[i]=="." and ss[i-1]=="#":
        b+=1
        ss[i-1]="."

print(min(b,h))
