let () = Scanf.scanf "%d\n%s" @@ fun n s ->
  Printf.printf "%d\n" @@
  Array.fold_left ( + ) 0 @@
  Array.init (n - 2) @@ fun i ->
    if s.[i] = 'A' && s.[i + 1] = 'B' && s.[i + 2] = 'C'
    then 1
    else 0
