let split_string ?(pattern="") = Str.split @@ Str.regexp pattern
let n = Scanf.sscanf (read_line ()) "%d" @@ fun n -> n
let s = read_line () |> split_string
let () = Printf.printf "%d\n" @@ snd @@ List.fold_left (fun (b, sum) ch -> (b || ch = "#", sum + if b && ch = "#" then 1 else 0)) (false, 0) s