n=int(input())
s=input()

ans=0
for i in range(n-1):
    if s[i]=="#" and s[i+1]==".":
        cnt=1
        j=i+2
        while j<n and s[j]==".":
            cnt+=1
            j+=1
        ans+=cnt
print(ans)