let () = Scanf.scanf "%d\n%s" @@ fun n s ->
  let (dpw, dpb) =
    Array.fold_left (fun (dpw, dpb) c ->
      if c = '#'
      then (1 + min dpw dpb, min dpw dpb)
      else (dpw, 1 + min dpw dpb)) (0, 0) @@
    Array.init n (String.get s) in
  Printf.printf "%d\n" @@ min dpw dpb
  

