n=int(input())
s=list(input())
f=0
cnt1=0
for i in range(n):
    if s[i]=="#":
        f=1
    else:
        if f:
            cnt1+=1

cnt2=0
f=0
for i in range(n-1,-1,-1):
    if s[i]==".":
        f=1
    else:
        if f:
            cnt2+=1
print(min(cnt1,cnt2))
