main=do
 getLine;s<-getLine
 print(f s)
  where f ('#':s) = f s
        f s = g (reverse s)
        g ('.':s) = g s
        g s = max (h (reverse s) 0 0) (i s 0 0)
        h ('.':s) x y = h s x (y+1)
        h ('#':s) x y = h s (x+y) 0
        h s x y = x
        i ('#':s) x y = i s x (y+1)
        i ('.':s) x y = i s (x+y) 0
        i s x y = x