// unihernandez22
// https://atcoder.jp/contests/abc150/tasks/abc150_b
// implementation

import std.stdio: readln, writeln;
import std.string: chomp;
import std.algorithm: count;

void main() {
	readln;
	string s = readln.chomp;
	s.count("ABC").writeln;
}
