n=int(input())
s=list(input())
ans=0
s.append('A')
if s[0]=='#':
    a=1
    while s[a]=='.' and a!=n-1:
        a+=1
        ans+=1
for i in range(1,n):
    if s[i]=='#' and i!=n-1:
        a=i+1
        while s[a]=='.' and a!=n:
            a+=1
            ans+=1

print(ans)