import copy

n=int(input())
stemp=input()
s=[ i for i in stemp]
s.append("NG")

ans=0
f=0
f2=0
if s[0]=="#":
    f2=1
for i in range(n):
    if f2 and s[i]==".":
        ans+=1
    else:
        if f:
            if s[i]==".":
                ans+=1
        elif s[i]=="." and s[i+1]=="#":
                f=1
    #print(s[i], i, f, f2,ans)

print(ans)