module Main where

import           Control.Monad
import           Data.List
import           Data.Ord
import           Data.List.Split
import           Data.Array.IO
import qualified Data.Vector            as V
import           Data.Maybe
import           Text.Printf

main :: IO ()
main = do
  _ <- getLine
  s <- getLine
  print $ f s

f s | isNothing $ '#' `elemIndex` s = 0
    | otherwise = length . elemIndices '#' $ take (last (elemIndices '#' s)) s
