Problem:


Score : 200 points

Problem Statement

We have a string S of length N consisting of uppercase English letters.

How many times does ABC occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Constraints

3 \leq N \leq 50

S consists of uppercase English letters.

Input

Input is given from Standard Input in the following format:

N
S

Output

Print number of occurrences of ABC in S as contiguous subsequences.

Sample Input 1

10
ZABCDBABCQ

Sample Output 1

2

Two contiguous subsequences of S are equal to ABC: the 2-nd through 4-th characters, and the 7-th through 9-th characters.

Sample Input 2

19
THREEONEFOURONEFIVE

Sample Output 2

0

No contiguous subsequences of S are equal to ABC.

Sample Input 3

33
ABCCABCBABCCABACBCBBABCBCBCBCABCB

Sample Output 3

5



Sample input:
10
ZABCDBABCQ


Sample output:
2

Submission status: Runtime Error

Solution code:
# https://atcoder.jp/contests/abc150/tasks/abc150_b
import sys
def read_int(): return int(input())
def read_str_n(): return list(map(str, input().split()))

def error_print(*args): print(*args, file=sys.stderr)
def mt(f):
    import time
 
    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()
 
        error_print(e - s, 'sec')
        return ret
 
    return wrap



__DEBUG__ = False

if __DEBUG__:
    N = 33
    S = list('ABCCABCBABCCABACBCBBABCBCBCBCABCB')
else:
    N = read_int()
    S = read_str_n()

@mt
def solution():
    count = 0    
    for i in range(N-2):
        if __DEBUG__: print(f"checking {S[i]} at index: {i}")
        if S[i] == 'A':
            if S[i+1] == 'B' and S[i+2] == 'C':
                count += 1
                continue
    
    
    print(f"{count}")
    
if __name__ == '__main__':
    solution()

Submission status: Runtime Error

Solution code:
def abc151_b():
    N, K, M = map(int, input().split())
    A = sum(list(map(int, input().split())))
    need = max(0, N * M - A)
    ans = need if need <= K else - 1
    print(ans)

abc151_b()

Submission status: Runtime Error

Solution code:
33
ABCCABCBABCCABACBCBBABCBCBCBCABCB

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
count = 0
for i in range(1, n):
    if s[i - 1] == "A" and s[i] == "B" and s[i+1] == "C":
        count += 1
    else:
        pass
print(count)

Submission status: Runtime Error

Solution code:
n = input()
s = input()
print(s.count('ABC))

Submission status: Runtime Error

Solution code:
N = int(input())
S = str(input())
 
num = 0
for i in range(N-2):
  if S[i:i+2] = "ABC":
    num += 1
  else:
    num += 0
print(num)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
 
num = 0
for i in range(N-2):
  if S[i:i+2] = "ABC":
    num += 1
  else:
    num += 0
print(num)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
 
num = 0
for i in len(S)-2:
  if S[i:i+2] = "ABC":
    num += 1
  else:
    num = num
print(num)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()

num = 0
for i in range(len(S)-2):
  if S[i:i+2] = "ABC":
    num += 1
  else:
    num = num

print(num)

Submission status: Runtime Error

Solution code:
# N, Sを入力
n = input()
s = input()

results = re.findall(r"ABC", s)

print(len(results))

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()

c = 0

for i in range(N-2):
  if S[i,i+2] == 'ABC':
    c += 1
    
print(c)

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
print(s.count('ABC')

Submission status: Runtime Error

Solution code:
#[allow(dead_code)]
fn is_whitespace(c: &char) -> bool {
    c.is_whitespace()
}

#[allow(dead_code)]
fn is_eol(c: &char) -> bool {
    ['\r', '\n'].contains(c)
}

#[allow(unused_macros)]
macro_rules! input {
    ($var:ident, $($r:tt)*) => {
        input_inner!{$var, $($r)*}
    };

    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        #[allow(unused_mut, unused_variables, bare_trait_objects)]
        let mut next = move |f: &Fn(&char)->bool| -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|f(&c))
                .take_while(|c|!f(&c))
                .collect()
        };
        input_inner!{next, $($r)*};
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; eol ]) => {
        $next(&is_eol).split(' ').map(|x| x.parse::<$t>().unwrap()).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, parser) => {
        $next
    };

    ($next:expr, $t:ty) => {
        $next(&is_whitespace).parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{BinaryHeap, HashMap};

#[allow(dead_code)]
type Graph = Vec<Vec<usize>>;
#[allow(dead_code)]
const M: usize = 1e9 as usize + 9;

fn main() {
    input! {
        n: usize,
        s: chars,
    }

    let mut c = 0;
    for i in 0..s.len() - 2 {
        if s[i..i + 3].iter().cloned().collect::<String>() == "ABC" {
            c += 1;
        }
    }
    println!("{}", c);
}

Submission status: Runtime Error

Solution code:
N=int(input())
S=list(input())
x=count=0
search_word=["A","B","C"]
 
for x in range(N):
  if S[x]==search_word[0] and S[x+1]==search_word[1] and S[x+2]==search_word[2]:
    count+=1
  x+=1
 
print(count)

Submission status: Runtime Error

Solution code:
N=input()
S=list(input())
x=count=0
search_word=["A","B","C"]

for i in S:
  if S[x]==search_word[0] and S[x+1]==search_word[1] and S[x+2]==search_word[2]:
    count+=1
  x+=1

print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
S = str(input())
p = "abc"
print(len(re.findall("abc", S)))

Submission status: Runtime Error

Solution code:
N = int(input())
S = str(input())
p = "abc"
print(N.count(p))

Submission status: Runtime Error

Solution code:
N = int(input())
S = str(input())
p = "abc"
print(s.count(p))

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
p = "abc"
print(s.count(p))

Submission status: Runtime Error

Solution code:
n = input()
print(inpur().count("ABC"))

Submission status: Runtime Error

Solution code:
n=int(input())
s=input()
count=0
for i in range(0,n):
  if s[i]=="A" and s[i+1]=="B" and s[i+2]=="C":
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
cnt=0
for i in range(n-2):
  if s[i] == "a" && s[i+1] == "b" && s[i+2] == "c":
    cnt+=1
print(cnt)

Submission status: Runtime Error

Solution code:
n = int(input())
s = list(input())
type = "A"
count = 0
for char in s:
    if char == "A"
        type = "B"
    elif char == "B" and type == "B":
        type = "C"
    elif char == "C" and type == "C":
        count += 1
        type = "A"
    else:
        type = "A"
print(count)

Submission status: Runtime Error

Solution code:
N=input()
print(input().count("ABC")

Submission status: Runtime Error

Solution code:
k,x = map(str, input().split())
x.count("ABC")

Submission status: Runtime Error

Solution code:
N = int(input())
S = int(input())
print(S.count('ABC'))

Submission status: Runtime Error

Solution code:
n = int(input())
s = str(inout())

ans = 0

for i in range(n-2):
    if s[i] == "A" and s[i+1] == "B" and s[i+2] == "C":
        ans += 1
    else:
        continue
      
print(ans)

Submission status: Runtime Error

Solution code:
n = inr(input())
s = str(inout())

ans = 0

for i in range(n):
	if s[i] == "A" and s[i+1] == "B" and s[i+2] == "C":
      ans += 1
    else:
      continue
      
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
s=input()
cnt=0
for i in range(n-2):
	if s[i:i+3] == "ABC":
	[]	cnt+=1
print(cnt)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
cnt = int(input())
str = input()
print(srt.count('ABC'))

Submission status: Runtime Error

Solution code:
a=int(input())
b=input()

count=0
for i in range(a-2):
  if b[i]='a'and b[i+1]='b' and b[i+2]='c':
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
n=int(input())
s=list(input())
d=0
for i in range(n):
  if n-(i+1)>=2:
    if s[i]=='A' and s[i+1]=='B' and s[i+2]=='C':
      d+=1
    else:
      pass
  else:
    pass
print(c)

Submission status: Runtime Error

Solution code:
n=int(input())
s=list(input())
d=0
for i in range(n):
  if n-(i+1)>=2:
    if s[i]=='A' and s[i+1]=='B' and s[i+2]=='C':
      d+=1
  else:
    pass
print(c)

Submission status: Runtime Error

Solution code:
n=int(input())
s=list(input())
d=0
for i in range(n):
  if n-(i+1)>=2:
    
    if s[i]=='A' and s[i+1]=='B' and s[i+2]=='C':
      d+=1
  
print(c)

Submission status: Runtime Error

Solution code:
n=int(input())
s=list(input())
d=0
for i in range(n):
  if n-1-i>=2:
    
    if s[i]=='A' and s[i+1]=='B' and s[i+2]=='C':
      d+=1
  
print(c)

Submission status: Runtime Error

Solution code:
n=int(input())
s=list(input())
d=0
for i in range(n):
  if n-i>=2:
    
    if s[i]=='A' and s[i+1]=='B' and s[i+2]=='C':
      d+=1
  
print(c)

Submission status: Runtime Error

Solution code:
n = int(input())
s = list(input())

A_index = [i for i, x in enumerate(s) if x == 'A']

count = 0
for j in A_index :
  if j != n-1 :
    if s[j+1] == 'B' :
      if s[j+2] == 'C' :
        count += 1

print(count)

Submission status: Runtime Error

Solution code:
n=int(input())
s=list(input())
d=0
for i in range(n):
  if s[i]=='A' and s[i+1]=='B' and s[i+2]=='C':
    d+=1
  
print(d)

Submission status: Runtime Error

Solution code:
n=int(input())
s=list(input())
d=0
for i in range(n):
  if s[i]=='A' and s[i+1]=='B' and s[i+2]=='C':
    d+=1
  
print(c)

Submission status: Runtime Error

Solution code:
[K, X] = [int(x) for x in input().split()]
if K * 500 >= X:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
count = 0
for i in range(n):
  if s[i] == "A" and s[i+1] == "B" and s[i+2] =="C":
    count +=1
print(count)

Submission status: Runtime Error

Solution code:
a=int(input())
b=list(input())
c=0
for i in range(a):
  if b[i]=='A' and b[i+1]=='B' and b[i+2]=='c':
    c+=1
  
print(c)

Submission status: Runtime Error

Solution code:
S = input()
N = int(input())
count = 0
S = S.split('ABC')
for i in S:
    if i == '':
        count += 1
    else: continue
print (count)

Submission status: Runtime Error

Solution code:
import sys

ans = 0
input = sys.stdin.readline
N = int(input())
S = input().rstrip()

list_S = list(S)

for i in range(N):
    if list_S[i] == 'A':
        if list_S[i + 1] == 'B':
            if list_S[i + 2] == 'C':
                ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
S = list(input())

count = 0

if N >= 3:
    for i in range(N - 1):
        if S[i] == 'A' and S[i + 1] == 'B' and S[i + 2] == 'C':
           count += 1
    print(count)
else:
    print(0)

Submission status: Runtime Error

Solution code:
S = input()
N = int(input())
count = 0
a = S.split('ABC')
for i in a:
    if i == '':
        count += 1
    else: continue
print (count)

Submission status: Runtime Error

Solution code:
a=int(input())
b=[]
bb=list(input())
for i in bb:
  b.append(i.upper())
c=0
for i in range(a):
  if b[i]=='A':
    if b[i]+b[i+1]+b[i+2]=='ABC':
      c+=1
    else:
      pass
  else:
    pass
print(c)

Submission status: Runtime Error

Solution code:
a=int(input())
b=[]
bb=list(input())
for i in bb:
  b.append(i.upper())
c=0
for i in range(a):
  if b[i]=='A':
    if b[i]+b[i+1]+b[i+2]=='ABC':
      c+=1
  else:
    pass
print(c)

Submission status: Runtime Error

Solution code:
N = int(input())
S = list(input())

count = 0
for i in range(N - 1):
    if S[i] == 'A' and S[i + 1] == 'B' and S[i + 2] == 'C':
        count += 1

print(count)

Submission status: Runtime Error

Solution code:
a=int(input())
b=list(input())
b.upper()
c=0
for i in range(a):
  if b[i]=='A':
    if b[i]+b[i+1]+b[i+2]=='ABC':
      c+=1
  else:
    pass
print(c)

Submission status: Runtime Error

Solution code:
a=int(input())
b=list(input())
b.str.upper()
c=0
for i in range(a):
  if b[i]=='A':
    if b[i]+b[i+1]+b[i+2]=='ABC':
      c+=1
  else:
    pass
print(c)

Submission status: Runtime Error

Solution code:
N,S = list(map(str,input().split(' ')))
pattern = 'ABC'
count =0
flag=True
start=0
while flag:
    a = S.find(pattern,start)  
                                
    if a==-1:         
        flag=False
    else:              
        count+=1        
        start=a+1
print(count)

Submission status: Runtime Error

Solution code:
from collections import defaultdict, deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys
import random
import itertools
import math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt


def LI(): return list(map(int, input().split()))


def LF(): return list(map(float, input().split()))


def LI_(): return list(map(lambda x: int(x)-1, input().split()))


def II(): return int(input())


def IF(): return float(input())


def LS(): return list(map(list, input().split()))


def S(): return list(input().rstrip())


def IR(n): return [II() for _ in range(n)]


def LIR(n): return [LI() for _ in range(n)]


def FR(n): return [IF() for _ in range(n)]


def LFR(n): return [LI() for _ in range(n)]


def LIR_(n): return [LI_() for _ in range(n)]


def SR(n): return [S() for _ in range(n)]


def LSR(n): return [LS() for _ in range(n)]


def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x % y)


def my_index_multi(l, x):
    return [i for i, _x in enumerate(l) if _x == x]


def sosu(x):
    for i in range(2, int(sqrt(x)+1)):
        if x % i == 0:
            return False
    return True


mod = 1000000007
inf = float('INF')


def A():
    K, X= LI()

    if (500*K>=X):
        print('Yes')
    else:
        print('No')


    return

# B


def B():
    N=II()
    S=input().rstrip()
    ans=0
    s=0
    for i in S:
        if (i=="A" and S[s+1]=='B' and S[s+2]=='C'):
            ans+=1
        s+=1
    print(ans)



    return

# C


def true():
    S = input()
    S = S[:-1]

    tmp = 0
    for x in range(1 << (len(S)-1)):
        func = S[-1]
        for i in range(len(S)-1):
            if(x & (1 << i)):
                tmp += int(func)
                func = S[-2-i]
            else:
                func = S[-2-i]+func
        tmp += int(func)
    print(tmp)

    return


def flagcounter(x):
    if (x == 0):
        return 0
    return flagcounter(x >> 1)+(x & 1)

def jisyo(P):
    i=1
    S = sorted(P)
    X=0
    N=len(P)
    for p in P:
    
        X+=((S.index(p)+1) * (math.factorial(N-i)))-1
        
        S.remove(p)
        if len(S)==1:
            break
        i+=1
    return X

def C():
    N=II()
    P=LI()
    Q=LI()

    X=jisyo(P)
    Y=jisyo(Q)


    print(X-Y)
        
    return


# D
def D():
    N, K = LI()
    R, S, P = LI()
    T=list(input().rstrip())
    ans = 0
    for j in range(K):
        if T[j] == 'r':
            ans += P
        if T[j] == 'p':
            ans += S
        if T[j] == 's':
            ans += R
    j = 0
    rps=['r','p','s']

    for i in range(K, N):
        if T[j] == T[i]:
            if i+K>=N:
                j += 1
                continue
            T[i]=rps[rps.index(T[i+K])-1]
            j += 1
            continue
        if T[i] == 'r':
            ans += P
        if T[i] == 'p':
            ans += S
        if T[i] == 's':
            ans += R
        j += 1
    print(ans)
    return


def Dsyakutori():

    N, K = LI()
    A = LI()
    MAX = sum(A)
    if MAX < K:
        print(0)
        return
    Temp = MAX
    ans = 1
    for i in range(N):
        Temp = Temp-A[i]
        if (Temp >= K):
            ans += 1
        else:
            T = Temp+A[i]
            break
    Temp = T
    ckeep = N
    for k in range(N):
        c = N-1
        i -= 1
        Temp = T

        for j in range(N):
            Temp = Temp-A[c]
            if (Temp >= K):
                ans += 1

            elif(c < ckeep and i >= 0):
                ans += i
                ckeep = c
                break
            else:
                ckeep = c
                break
            c -= 1
        if i < 0:
            break
        T = T+A[i]
    print(ans)

    return

# E


def E():
    N, M= LI()
    A = LI()
    A.sort(reverse=True)
    B=[0]*(N+1)
    for i in range(1,N+1):
        B[i]=B[i-1]+A[i-1]
    D=[0]*(2*10**5+1)
    for i in range(N):
        D[A[i]]+=1
    for i in range(len(D)-1,0,-1):
        D[i-1]+=D[i]
    l=-1
    r=2*10**5+1
    while r-l>1:
        m=(l+r)//2
        s=0
        for i in range(N):
            s+=D[max(1,m-A[i])]
        if s>=M:
            l=m
        else:
            r=m
    ans=0
    s=0
    for i in range(N):
        v=max(0,r-A[i])
        t=max(0,min(D[v],M-s))
        ans+=B[t]+t*A[i]
        s+=t
    ans+=l*(M-s)
    print(ans)

    
    return

# F


def F():
    N, M = LI()

    value = [0] * M
    power = [0] * M
    for i in range(M):
        a, b = LI()
        value[i] = a
        c = LI()
        L = ['0'] * N
        for k in c:
            L[k - 1] = '1'
        bint = ''.join(L)
        power[i] = int(bint, 2)
    bint = ''.join(list(['1'] * N))
    dp = [inf] * (int(bint, 2)+1)
    t = 0
    cost = 0

    dp[0] = 0
    for s in range(int(bint, 2) + 1):
        for i in range(M):
            t = s | power[i]
            cost = dp[s] + value[i]
            dp[t] = min(dp[t], cost)
    print(-1) if(dp[-1] == inf) else print(dp[-1])

    return

    # you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")


def solution(S):
    # write your code in Python 3.6
    N = len(S)

    pass


# Solve
if __name__ == '__main__':

    B()

Submission status: Runtime Error

Solution code:
a=int(input())
b=list(input().str.upper())
c=0
for i in range(a):
  if b[i]=='A':
    if b[i]+b[i+1]+b[i+2]=='ABC':
      c+=1
  else:
    pass
print(c)

Submission status: Runtime Error

Solution code:
b, c = map(str, input().split())
print(c.count('ABC'))

Submission status: Runtime Error

Solution code:
N = int(input())
S = str(input())
c = 0
for i in range(0,N):
    if S[i] == 'A' and S[i+1]== 'B' and S[i+2] == 'C':
        c += 1
print(c)

Submission status: Runtime Error

Solution code:
N=input()
P=input()
Q=input()
s=0
x=0
a=0
b=0
while(int(s)<=int(N)):
  s=int(s)+1
  x=(format(x)+' '+format(s))
while(str(P)>=str(x)):
  a=int(a)+1
while(str(Q)>=str(x)):
  b=int(b)+1
print(int(a)-int(b))

Submission status: Runtime Error

Solution code:
N = int(input())
S = str(input())
c = 0
for i in range(0,len(S)):
    if S[i] == 'A' and S[i+1]== 'B' and S[i+2] == 'C':
        c += 1
print(c)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
count = 0
for i in range(1,N-1):
  if S[i-1] + S[i] + s[i+1] == "ABC":
    count = count + 1
print (count)

Submission status: Runtime Error

Solution code:
N = input()
S = input()
count = 0
for i in range(1,int(N)-1):
  if S[i-1] + S[i] + S[i+1] = "ABC":
    count = count + 1
print(count)

Submission status: Runtime Error

Solution code:
a=int(input())
b=list(input())
c=0
for i in range(a):
  if b[i]=='A':
    if b[i]+b[i+1]+b[i+2]=='ABC':
      c+=1
  else:
    pass
print(c)

Submission status: Runtime Error

Solution code:
N = int(input)
S = input()
count = 0
for i in range(1,N-1):
  if S[i-1] + S[i] + s[i+1] == "ABC":
    count += 1
	print (count)

Submission status: Runtime Error

Solution code:
S = input() 
X = int(S.split("/n")[0])
Y = S.split("/n")[1]
count = 0
for i in range(X-2):
  if X[i:i+3] == "ABC":
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
N = input()
S = input()
print(s.count('ABC'))

Submission status: Runtime Error

Solution code:
N = input()
S = input()
count = 0
if(int(N)>=3 and int(N)<=50):
    for i in range(1, int(N)-1):
        if S[i-1]+S[i]+S[i+1] == "ABC":
            count += 1
    print(count)
Seen by Sokhom Sovichea at 19:59

Submission status: Runtime Error

Solution code:
    N = input()
    S = input()
    count = 0
    if int(N) >= 3 and int(N) <= 50:
      for i in range(1, int(N)-1):
        if S[i-1] + S[i] + S[i+1] == "ABC":
          count += 1
    print(count)

Submission status: Runtime Error

Solution code:
a=int(input())
b=list(input())
c=0
for i in range(a):
  if b[i]=='A':
    if b[i]+b[i+1]+b[i+2]=='ABC':
      c+=1
print(c)

Submission status: Runtime Error

Solution code:
int N = input()
String S = input()
print(s.count('ABC'))

Submission status: Runtime Error

Solution code:
S = input()
N = int(input())
count = 0
if N >= 3 and N <= 50:
	d = ''
	for j in S:
    	d += j
    	if len(d) == N:break
	a = d.split('ABC')
	for i in a:
    	if i == '':
        	count += 1
    	else: continue
print (count)

Submission status: Runtime Error

Solution code:
N = input()
S = input()
count = 0
if int(N) >= 3 and int(N) <= 50:
  for i in range(1, int(N)-1):
    if s[i-1] + s[i] + s[i+1] == "ABC":
      count += 1
print(count)

Submission status: Runtime Error

Solution code:
N = int(input)
S = input()
count = 0
if N >= 3 and N <= 50:
	for i in range(1,N-1):
  		if S[i-1] + S[i] + s[i+1] == "ABC":
    	count = count + 1
print (count)

Submission status: Runtime Error

Solution code:
a=int(input())
b=list(input())
c=0
d=0
for i in range(a):
  if b[i]=="A":
    d+=1
  
    if d==1 and b[i+1]=='B':
      
        
      d+=1
      if d==2 and b[i+2]='C':
          
          
        
        
          d=0
          c+=1
  else:
    d=0
        
      
print(c)

Submission status: Runtime Error

Solution code:
a=int(input())
b=list(input())
c=0
d
for i in range(a):
  if b[i]=="A":
    d+=1
  
    if d==1 and b[i+1]=='B':
      
        
      d+=1
      if d==2 and b[i+2]='C':
          
          
        
        
          d=0
          c+=1
  else:
    d=0
        
      
print(c)

Submission status: Runtime Error

Solution code:
k, x = input().split()
k = int(k) * 500
if (k >= int(x)):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
N = int(input)
S = input()
count = 0
for i in range(1,N-1):
  if S[i-1] + S[i] + s[i+1] == "ABC":
    count = count + 1
print (count)

Submission status: Runtime Error

Solution code:
N = input()
S = input()
count = 0
for i in range(1, int(N)-1):
  if s[i-1] + s[i] + s[i+1] == "ABC":
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
total = int(input())
text = input()

res = 0

if total >= 3:
    for x in range(0, total - 1):
        if text[x] == "A":
            if x + 2 <= total:
                if text[x + 1] == "B" and text[x + 2] == "C":
                    res += 1

print(res)

Submission status: Runtime Error

Solution code:
N = input()
S = input()
for i in range(1, int(N)-1):
    if s[i-1] + s[i] + s[i+1] == "ABC":
        count += 1
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
count = 0
for i in range(1, N - 1):
  if S[i-1] + S[i] + S[i + 1] = 'ABC':
    count += 1
print (count)

Submission status: Runtime Error

Solution code:
N=int(input())
S=input()

if

Submission status: Runtime Error

Solution code:
S = input()
N = int(input())
count = 0
d = ''
for j in S:
    d += j
    if len(d) == N:break
a = d.split('ABC')
for i in a:
    if i == '':
        count += 1
    else: continue
print (count)

Submission status: Runtime Error

Solution code:
n = input()
s = input()
flag = 0
for i in range(1,int(n)-1):
  if s[i-1] + s[i] + s[i+1] = "ABC":
    flag += 1
print(flag)

Submission status: Runtime Error

Solution code:
Num=int(Input())
Str=str(Input())
print(str.count("ABC"))

Submission status: Runtime Error

Solution code:
a=int(input())
b=list(input())
c=0
for i in range(a):
  if b[i]=="A":
    if b[i+1]=="B":
      if b[i+2]=="C":
        c+=1
        continue
      
print(c)

Submission status: Runtime Error

Solution code:
total = int(input())
text = input()

res = 0

if total != 0:
    for x in range(0, total - 1):
        if text[x] == "A":
            if x + 2 <= total:
                if text[x + 1] == "B" and text[x + 2] == "C":
                    res += 1

print(res)

Submission status: Runtime Error

Solution code:
int N = input()
int S = input()
print(S.count("ABC"))

Submission status: Runtime Error

Solution code:
n = input()
s = input()
count = 0
for i in range(1,int(n)-1):
  if s[i-1] + s[i] + s[i+1] = "ABC":
    count = count + 1
print(count)

Submission status: Runtime Error

Solution code:
put=int(Input())
str=str(Intput())
print(str.count("ABC"))

Submission status: Runtime Error

Solution code:
int N = input()
str S = input()

res = count("ABC")
print(res)

Submission status: Runtime Error

Solution code:
num = int(input())
s=list(input())
ss = 0

for i in range(num):
  if "A" == s[i]:
    if "B" == s[i + 1]:
      if "C" == s[i + 2]:
        ss += 1
print(ss)

Submission status: Runtime Error

Solution code:
total = int(input())
text = input()

res = 0

for x in range(0, total - 1):
    if text[x] == "A":
        if x + 2 <= total:
            if text[x + 1] == "B" and text[x + 2] == "C":
                res += 1

print(res)

Submission status: Runtime Error

Solution code:
n = int(input())
s = list(input())

A_index = [i for i, x in enumerate(s) if x == 'A']
print(A_index)

count = 0
for j in A_index :
  print(j)
  if j != n-1 :
    if s[j+1] == 'B' :
      if s[j+2] == 'C' :
        count += 1

print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
count = 0
list(S)

for i in range(len(S)):
    if('A' == S[i]):
        i += 1
        if('B' == S[i]):
            i += 1
            if('C' == S[i]):
                count += 1

print(count)

Submission status: Runtime Error

Solution code:
N = int(raw_input())
S = raw_input()
count = 0
for i in range(len(S)):
  if len(S)!=N:
    break
  else:
    if S[i].islower():
      break
    else:
      if(S[i]=="A"):
        if(S[i+1]=="B"):
          if(S[i+2]=="C"):
            count = count+1
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
count = 0
for i in range(len(S)):
  if len(S)!=N:
    break
  else:
    if S[i].islower():
      break
    else:
      if(S[i]=="A"):
        if(S[i+1]=="B"):
          if(S[i+2]=="C"):
            count = count+1
print(count)

Submission status: Runtime Error

Solution code:
total = int(input())
text = input()

res = 0

for x in range(0, total-1):
  if x == "A":
    if x+2 =< total:
      if text[x+1] == "B" and text[x+2] == "C":
        res += 1
      
print(res)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
c = 0
fi = list(S)
for i in range(N):
    if S[i] == "A":
        if S[i+1] == "B":
            if S[i+2] == "C":
                c += 1
print(c)

Submission status: Runtime Error

Solution code:
n = int(input())
s = list(input())

A_index = [i for i, x in enumerate(s) if x == 'A']
print(A_index)

count = 0
for j in A_index :
  print(j)
  if j != n-2 :
    if s[j+1] == 'B' :
      if s[j+2] == 'C' :
        count += 1

print(count)

Submission status: Runtime Error

Solution code:
    n = input()
    s = input()
    flag = 0
    for i in range(1,int(n)-1):
    	if s[i-1]+s[i]+[i+1] = "ABC":
        	flag += 1
    print(flag)

Submission status: Runtime Error

Solution code:
n = input()
s = input()
flag = 0
for i in range(1,int(n)-1):
	if s[i-1]+s[i]+[i+1] = "ABC"
    	flag += 1
print(flag)

Submission status: Runtime Error

Solution code:
a=int(input())
b=input()
for 
for i in range(a-2):
	if b[i:i+1] == "A":
		if b[i+1:i+2] == "B":
			if b[i+2:i+3] == "C":
				sum+=1
			pass
		pass
	pass
print(sum)

Submission status: Runtime Error

Solution code:
a=int(input())
b=list(input())
c=0
for i in range(a):
  if b[i]=="A":
    if b[i+1]=="B":
    
      if b[i+2]=="C":
        c+=1
      
print(c)

Submission status: Runtime Error

Solution code:
n = input()
s = input()
flag = 0
for i in range(1,n-1):
	if s[i-1]+s[i]+[i+1] = "ABC"
    	flag=flag+1
print(flag)

Submission status: Runtime Error

Solution code:
a=int(input())
b=input()
for 
for i in range(a-2):
	if b[i:i] == "A":
		if b[i+1:i+1] == "B":
			if b[i+2:i+2] == "C":
				sum+=1
			pass
		pass
	pass
print(sum)

Submission status: Runtime Error

Solution code:
n = input()
s = input()
flag = 0
for i in range(1,n-1):
	if s[i-1]+s[i]+[i+1] = "ABC":
    	flag++
print(flag)

Submission status: Runtime Error

Solution code:
a=int(input())
b=list(input())
c=0
for i in range(a):
  if b[i]=="A":
    if b[i+1]=="B":
    else:
      pass
      if b[i+2]=="C":
        c+=1
      else:
        pass
  else:
    pass
print(c)

Submission status: Runtime Error

Solution code:
length = int(input())
string = input()
count=0

if(length>=3):
    for i in range(0,length):
        if ("A" == string[i]) and ("B" == string[i+1]) and ("C" == string[i+2]):
            count+=1
            i+=3
            if i>length-3:
                break

print(count)

Submission status: Runtime Error

Solution code:
N = list(int(input())
S = list(input())
S.count('ABC')

Submission status: Runtime Error

Solution code:
a=int(input())
b=input()
for 
for i in range(a-2):
	if b[a:a] == "A":
		if b[a+1:a+1] == "B":
			if b[a+2:a+2] == "C":
				sum+=1
			pass
		pass
	pass
print(sum)

Submission status: Runtime Error

Solution code:
n = input()
s = input()
flag = 0
for i in range(1,int(n)-1):
	if s[i-1]+s[i]+[i+1] = "ABC"
    	flag++
print(flag)

Submission status: Runtime Error

Solution code:
a=int(input())
b=list(input())
c=0
for i in range(a):
  if b[i]=="A":
    if b[i+1]=="B":
    else:
      pass
      if b[i+2]=="C":
        c+=1
  else:
    pass
print(c)

Submission status: Runtime Error

Solution code:
N=int(input())
s=input()
S=list(s)
#print(S[0])
flg=0
for i in range(N-1):
    if S[i] == 'A':
        if S[i+1] =='B':
            if S[i+2] =='C':
                flg+=1
print(flg)

Submission status: Runtime Error

Solution code:
a=input()
b=input()
for 
for i in range(a-2):
	if b[a:a] == "A":
		if b[a+1:a+1] == "B":
			if b[a+2:a+2] == "C":
				sum+=1
			pass
		pass
	pass
print(sum)

Submission status: Runtime Error

Solution code:
length = int(input())
string = input()
count=0
for i in range(0,length):
    if ("A" == string[i]) and ("B" == string[i+1]) and ("C" == string[i+2]):
        count+=1
        i+=3
        if i>length-3:
            break
print(count)

Submission status: Runtime Error

Solution code:
num = int(input())
bunsyo = input()
count = 0

for i in range(len(bunsyo)):
  if bunsyo[i] == 'A':
    if bunsyo[i+1] =='B':
      if bunsyo[i+2] == 'C':
        count = count + 1
print(count)