<filename>jp.atcoder/abc150/abc150_b/9410540.py
import sys

n, s = sys.stdin.read().split()
n = int(n)

def main():
    return s.count('ABC')

if __name__ == '__main__':
    ans = main()
    print(ans)

<filename>jp.atcoder/abc150/abc150_b/9410540.py
import sys

n, s = sys.stdin.read().split()
n = int(n)

def main():
    return s.count('ABC')

if __name__ == '__main__':
    ans = main()
    print(ans)
