let _ =
  let n = Scanf.scanf "%d\n" (fun n -> n) in
  let ar1 = Array.make n '#' in
  let ar2 = Array.make n '.' in
  let cnt1 = ref 0 in
  let cnt2 = ref 0 in
  for i = 0 to n - 1 do
    Scanf.scanf (if i <> n-1 then "%c" else "%c\n") (fun c -> ar1.(i) <- c; ar2.(i) <- c)
  done;
  for i = 0 to n - 2 do
    if ar1.(i) = '#' && ar1.(i + 1) = '.' then (ar1.(i + 1) <- '#'; cnt1 := !cnt1 + 1);
  done;
  for i = n - 2 downto 0 do
    if ar2.(i) = '#' && ar2.(i + 1) = '.' then (ar2.(i) <- '.'; cnt2 := !cnt2 + 1);
  done;
  print_int @@ min !cnt1 !cnt2
