import re



n = int(eval(input()))

s = eval(input())



x = re.sub(r'ABC', 'o', s)



print((x.count('o')))
n = int(eval(input()))

s = eval(input())



print((s.count('ABC')))
import re

n = int(eval(input()))
s = eval(input())
x = re.sub(r"ABC", "o", s)
print((x.count("o")))

n = int(eval(input()))
s = eval(input())
print((s.count("ABC")))

-import re - -x = re.sub(r"ABC", "o", s) -print((x.count("o"))) +print((s.count("ABC")))