n=int(input())
s=input()
ans=0
c=0   # まだ白だけな状態
for i in range(n):
  if s[i]=="." and c==0:
    continue
  elif s[i]=="." and c==1:
    ans += 1
  elif s[i]=="#" and c==0:
    c=1
  else:
    continue
print(ans)