n=int(input())
S=list(input())

count=0
if S.count(".")>S.count("#"):
    for i in range(n):
        if S[n-1]==".":
            if S[n-1-i]=="#":
                count+=1
        else:
            if S[n-1-i]==".":
                for j in range(n-i):
                    if S[n-i-2-j]=="#":
                        count+=1
                        
else:
    for k in range(n):
        if S[n-1]==".":
            if S[n-1-k]==".":
                count+=1
        else:
            if S[n-1-k]=="#":
                for l in range(n-k):
                    if S[n-k-2-l]==".":
                        count+=1
                        
print(count)