Array.(Scanf.scanf " %d %s %s %s" @@ fun n a b c ->
  init n (fun i ->
    match List.(length @@ sort_uniq compare [a.[i];b.[i];c.[i]]) with
    | 3 -> 2
    | 2 -> 1
    | _ -> 0
  ) |> fold_left (+) 0 |> print_int)