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