let _ = read_int ()
let f t s = Str.(let rec f a i r = String.(if i >= length s then a else try f (a + 1) (search_forward r s i + length t) r with _ -> a) in f 0 0 (regexp t))
let _ = f "ABC" (read_line ()) |> Printf.printf "%d\n"