# coding: utf-8
# Your code here!
n=int(input())
l=list(input())
m=0
b_ans=n
for i in range(len(l)-1):
    if (l[i]=="#" and l[i+1]=="."):
        b=l[m:].count(".")+l[:m].count("#")
        if(b<b_ans):
            b_ans=b
        #print(lm)

a=l.count("#")
c=l.count(".")
ans=min(a,b_ans,c)
print(ans)
#print(lm)