def main():
  import itertools
  
  n,s=int(input()),list(input())
  ans=0
  c=0
  m=""
  for a,b in itertools.groupby(s):
    if c==0:
      m=a
      c+=1
    else:
      if m=="#" and a==".":
        ans+=len(list(b))
  print(ans)
  
if __name__=="__main__":
  main()