# coding: utf-8
# Your code here!
n=int(input())
l=list(input())
m=0
lm=[]
for i in range(n):
    if (l[i]=="#"):
        lm=l[m:]
        break
a=lm.count(".")
b=lm.count("#")
ans=min(a,b)
print(ans)