n=int(input())
s=input()
a=0
b=0
p=0
ss=""
for i in range(n):
    if s[i]=="#":
        p=1
        a+=1
    elif p==1:
        b+=1
    ss=s[i]+ss
c=0
d=0
p=0
for i in range(n):
    if ss[i]==".":
        p=1
        c+=1
    elif p==1:
        d+=1

print(min(a,b,c,d))