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:
N = int(input())
S = list(map(str, input()))
count = 0
for i in range(len(S)):
    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 = str(input())

print(s.count('ABC')

Submission status: Runtime Error

Solution code:
from sys import stdin

lines = stdin.readlines()

n = int(lines[0].rstrip())
s = str(lines[1].rstrip())

counter = 0
for i in range(n-2):
if s[i] == 'A':
    if s[i+1] == 'B':
        if [i+2] == 'C':
            counter += 1
print(counter)

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 = count + 1

print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def check(number, text):
  n = 0
  count = 0
  while n < number:
    if text[n] == 'A':
      if text[n+1] == 'B':
        if text[n+2] == 'C':
          count += 1

    n += 1
  
  print(count)


input_num = int(input())
input_str = input()

check(input_num, input_str)

Submission status: Runtime Error

Solution code:
def check(number, string):
  n = 0
  count = 0
  while n < number:
    if string[n] == 'A':
      if string[n+1] == 'B':
        if string[n+2] == 'C':
          count += 1

    n += 1
  
  print(count)


input_num = int(input())
input_str = input()

check(input_num, input_str)

Submission status: Runtime Error

Solution code:
def check(number, string):
  n = 0
  count = 0
  while n < number:
    if string[n] == 'A':
      if string[n+1] == 'B':
        if string[n+2] == 'C':
          count += 1

    n += 1
  
  print(count)


input_num = int(input('length: '))
input_str = input('string: ')

check(input_num, input_str)

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
y = list(s)
ans = 0
for a in range(n):
    a = int(a)
    if y[a] == "A" and y[a+1] == "B" and y[a+2] == "C":
        ans += 1

print(ans)

Submission status: Runtime Error

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

for i in range(n):
  if i<=48 :
    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=list(input())
count=0
for i in range(n):
  if i<=48:
    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=list(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:
s = list(input())

ans = 0
for i in len(s-2):
  if s[i]=="A" and s[i+1] == "B" and s[i+2] ==  "C":
    ans += 1
    
print(ans)

Submission status: Runtime Error

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

def res():
    ct=0
    for i in range(n):
        if i+2 > n:
            return ct
        if s[i] =="A"and s[i+1]=="B" and s[i+2]=="C":
            ct+=1

print(res())

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

i = -1
c = 0

while True:
	i = s.find('ABC', i + 1)
	if i == -1:
		break
	c++
print(c)

Submission status: Runtime Error

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

print(len(s.split('ABC')) - 1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ans = 0
while 'ABC' in S:
    ans += 1
    S.remove('ABC')

print(ans)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-


N = int(input())
S = input()

count = 0

for i, s in enumerate(S):
    if s != 'A':
        continue
    else:
        if N >= i + 2 and S[i+1] == 'B' and S[i+2] == 'C':
            count += 1

print(count)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-


N = int(input())
S = input()

count = 0

for i, s in enumerate(S):
    if s != 'A':
        continue
    else:
        if S[i+1] == 'B' and S[i+2] == 'C':
            count += 1

print(count)

Submission status: Runtime Error

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

if int(n) >= 3 and int(n) =< 50:
    print(s.count('ABC'))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

while i < n - 2
    if s[i] == "A":
        if s[i + 1] == "B":
            if s[i+2] == "C":
                ing_total+= 1
print(ing_total)

Submission status: Runtime Error

Solution code:
S = intput()

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ans = 0
str_list = list(S)

for i in range (len(str_list)-2):
  if(str_list[i] == "A"):
    ans = ans
    if(str_list[i+1] == "B"):
      ans = ans
      if(str[i+2] == "C"):
        ans += 1

print(ans)

Submission status: Runtime Error

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

ans = 0
str_list = list(S)

for i in range (len(str_list)-2):
  if(str_list[i] == "A"):
    pass
    if(str_list[i+1] == "B"):
      pass
      if(str[i+2] == "C"):
        ans += 1

print(ans)

Submission status: Runtime Error

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

ans = 0
str_list = list(S)

for i in range (len(str_list)-2):
  if(str_list[i] == "A"):
    if(str_list[i+1] == "B"):
      if(str[i+2] == "C"):
        ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
N, S = map(str, input().split())
N = int(N)

ans = 0
str_list = list(S)

for i in range (len(str_list)-2):
  if(str_list[i] == "A"):
    if(str_list[i+1] == "B"):
      if(str[i+2] == "C"):
        ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
N, S = map(str, input().split())
N = int(N)

ans = 0
str_list = list(S)

for i in range (len(str_list)-2):
  if(str_list[i] == A):
    if(str_list[i+1] == B):
      if(str[i+2] == C):
        ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
pat = "ABC"

ans =0
i=0
while i < n:
  if pat = s[i:len(pat)]:
    ans+=1

print(ans)

Submission status: Runtime Error

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

cnt = 0

for i in range(0,4):
  if S[i] == "A" and S[i+1] == "C" and S[i+2] == "C":
    cnt += 1
    
print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
words = input()
ans = 0
for i, word in enumerate(words):
	if word == "A":
		if words[i+1] == "B":
			if words[i+2] == "C":
				ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
import sys
import math
import itertools

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
list = [str(x) for x in S]
index = 0
abc = 0
for alphabet in list:
  if alphabet == "A" and list[index + 1] == "B" and list[index + 2] == "C":
    abc += 1
  index += 1
print(abc)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
list = [str(x) for x in S]
index = 0
abc = 0
for alphabet in list:
  if alphabet == "A" and list[index + 1] == "B" and list[index + 2] == "C":
    abc += 1
  index += 1
if index != N - 1:
  break
print(abc)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
ans = 0


for i in range(n-2):
    if s[i:i+3] == "ABC":
        res += 1

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
ans = 0


for i in range(n):
    if s[i:i+3] == 'ABC':
        res += 1

print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
i = 0
count = 0

while i < n:
    if s[i] == 'A':
        if s[i+1] == 'B':
            if s[i+2] == 'C':
                count += 1
                i += 2
    i += 1

print(count)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

for i in range(0, N):
  if S[i] == 'A':
    if S[i + 1] == 'B':
      if S[i + 2] == 'C':
          numberABC += 1
print(numberABC)

Submission status: Runtime Error

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

def main():
  numberABC = 0

  for i in range(0, N):
    if S[i] == 'A':
      if S[i + 1] == 'B':
        if S[i + 2] == 'C':
          numberABC += 1
  print(numberABC)
  return numberABC

if __name__ == '__main__':
  main()

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
ans = 0
for i in range(N):
    if S[i] == "A" and i <= N - 2:
        if S[i + 1] == "B":
            if S[i + 2] == "C":
                ans += 1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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


for i in range(N):  
  if K[i] == "A":
    if K[i+1] == "B":
      if K[i+2] == "C":
        count += 1

print(count)

Submission status: Runtime Error

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


for i in range(N):
  if K[i-1] == "A":
    if K[i] == "B":
      if K[i+1] == "C":
        count += 1

print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
S = str(input())
cou = 0
for i in range(N):
  if i <= N-2:
    if S[i] == "A" and S[i+1] == "B" and S[i+2]== "C":
      cou += 1
print(cou)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = input()
S = input()
# N = 10
# S = 'ZABCDBABCQ'

ans = 0

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ans = 0
i = 0
while i < N:
    if S[i] == "A":
        i += 1
        if S[i] == "B":
            i += 1
            if S[i] == "C":
                ans += 1
            else:
                i += 1
        else:
            i += 1
    else:
        i += 1

print(ans)

Submission status: Runtime Error

Solution code:
from collections import deque


N, K = map(int, input().split())
P = list(map(int, input().split()))

smin = deque()
smax = deque()
x = 0
r = 0
r2 = 0

for i, p in enumerate(P):
    while len(smin) > 0 and P[smin[-1]] > p:
        smin.pop()
    smin.append(i)
    if smin[0] <= i - K:
        smin.popleft()
    while len(smax) > 0 and P[smax[-1]] < p:
        smax.pop()
    smax.append(i)
    if smax[0] <= i - K:
        smax.popleft()
    if i > 0 and P[i-1] < P[i]:
        x = min(x + 1, K - 1)
    else:
        x = 0
    if i == K-1 or (i >= K and not (P[i - K] < P[smin[0]] and smax[0] == i)):
        if x != K-1:
            r += 1
        else:
            r2 = 1
print(r + 1 if r2 else r)

Submission status: Runtime Error

Solution code:
n=map(int,input())
s=str(input())

count=0
for i in range(n-2):
    if s[i]=="A":
        if s[i+1]=="B":
            if s[i+2]=="C":
                count+=1

print(count)

Submission status: Runtime Error

Solution code:
n=map(int,input())
s=list(map(str,input()))

count=0
for i in range(n-2):
    if s[i]=="A":
        if s[i+1]=="B":
            if s[i+2]=="C":
                count+=1

print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def main(M,S):
    N = int(N)
    S = str(S)

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

    return c

if __name__ == '__main__':
    N = input()
    S = input()
    main(N,S)

Submission status: Runtime Error

Solution code:
def main():
    N, S = open(0).read().split('\n')
    print(S.count('ABC'))


if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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


print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = input()
S = input()
ABCCount  = 0

for n in range(int(N)):
    if S[n] == "A" and S[n+1] == "B" and S[n+2] == "C":
        ABCCount = ABCCount + 1

print(ABCCount)

Submission status: Runtime Error

Solution code:
n=int(input())
s=list(str(input()))
count=0
for i in range(len(s)):
    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()
count=0
for i in range(len(s)):
    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=input();s=input()
print(s.count('ABC')

Submission status: Runtime Error

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

ans = 0
for i in range(len(s)-2):
    ans += "ABC" == f"{s[i]}{s[i+1]}{s[i+2]}"

print(ans)

Submission status: Runtime Error

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

count = 0

for i in range(n):
    if s[i] == "A":
        if s[i+1] == "B":
            if s[i+2] == "C":
                count += 1

print(count)

Submission status: Runtime Error

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

count = 0

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

print(count)

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
count = 0

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

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
count = 0

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

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
count = 0

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

Submission status: Runtime Error

Solution code:
n=int(input())
s=input()
cnt=0
if len(s)<= 2:
  pass
else:
  for i in range(len(s)):
    if s[i]=='A' and s[i+1]=='B' and s[i+2]=='C':
      cnt += 1
print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input().split())
S = str(input().split())
i = 0
count = 0
for i in range(N-2):
  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 = map(int,input().split())
S = str(input().split())
i = 0
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:
N = int(input())
S = input()
print(S.count("ABC")

Submission status: Runtime Error

Solution code:
import sys
row = sys.stdin.readline
 
 
def read_int(row):
    return int(row().rstrip())
 
def read_string(row):
    return row().rstrip()
  
N = read_int(row)
S = read_string(row)
 
cnt = 0
for i in range(0, len(S) -3):
    if S[i] == "A" and S[i+1] == "B" and S[i+2] == "C":
        cnt +=1
print(cnt)
import sys
row = sys.stdin.readline


def read_int(row):
    return int(row().rstrip())

def read_string(row):
    return row().rstrip()
  
N = read_int(row)
S = read_string(row)

cnt = 0
for i in range(0, len(S) -2):
    if S[i] == "A" and S[i+1] == "B" and S[i+2] == "C":
        cnt +=1
print(cnt)
提出情報
提出日時

Submission status: Runtime Error

Solution code:
n=int(input())
s=str(input())
for _ in range(n-1):
  s = s + str(input())
n=s.count("ABC")
print(n)

Submission status: Runtime Error

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

print(S.count('ABC'))

Submission status: Runtime Error

Solution code:
n = int(input())
p = list(input())
q = list(input())

b = [s + 1 for s in range(n)]
print(b)
for i in p:
  print(i)

Submission status: Runtime Error

Solution code:
i = int(input())
j = input()
    
print(count('ABC'))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
for i in range(0,n-2):
    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 = input()
S = list(S)
count = 0
for i in range(N-1):
    if S[i] == "A":
        if S[i+1] == "B":
            if S[i+2] == "C":
                count+=1
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
S = list(S)
count = 0
for i in range(N):
    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()
S = list(S)
count = 0
for i in range(len(S)):
    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,s=input().split()

print(s.count('ABC'))

Submission status: Runtime Error

Solution code:

//HOLA MIM MI KLSJLFKJSLJFJSLDFSKJDFLK
input();s = input();print(s.count("ABC"))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = input().split("\n")[1]
print(a.count("ABC"))

Submission status: Runtime Error

Solution code:
a = input().split("¥n")[1]
print(a.count("ABC"))

Submission status: Runtime Error

Solution code:
a = input().split("¥n")[1]
print(len(a.split("ABC"))-1)

Submission status: Runtime Error

Solution code:
a = input().split("\n")[1]
print(len(a.split("ABC"))-1)

Submission status: Runtime Error

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

str_list = list(S)

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

print(count)

Submission status: Runtime Error

Solution code:
a,b=input().split("\n")
print(len(b.split("ABC"))-1)

Submission status: Runtime Error

Solution code:
a,b=map(int, input().split("\n"))
print(len(b.split("ABC"))-1)

Submission status: Runtime Error

Solution code:
_ = input()
S = input()
print(len(S.split("ABC") - 1))

Submission status: Runtime Error

Solution code:
_ = input()
S = input()
print(len(S.split("ABC") - 1)

Submission status: Runtime Error

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

n = str.count('ABC')
print(n)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = int(input())
b = input()
print(a.count('ABC'))

Submission status: Runtime Error

Solution code:
X=input()
c=list(input())
result=0
i=0
while i<len(c):
    if c[i]=='A':
        if c[i+1]=='B' and c[i+2]=='C':
            result+=1
            i+=1
        else:
            i+=1
    else:
        i+=1
print(result)

Submission status: Runtime Error

Solution code:
X=input()
c=list(input())
result=0
i=0
while i<len(c):
    if c[i]=='A':
        if c[i+1]=='B' and c[i+2]=='C':
            result+=1
            i+=3
        else:
            i+=1
    else:
        i+=1
print(result)

Submission status: Runtime Error

Solution code:
l = int(input())

word = input()

counter = 0
for i in range(len(word)):
  if len(word[i:]) >= 3:
    if word[i:i+2] == 'abc':
      counter += 1
      
return counter

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':
    # We have a string S of length N consisting of uppercase English letters.
    temp = input().split('\n')
    n = temp[0]
    s = temp[1]
    num = 0
    if 'ABC' in s:
        num += 1
        s = s.replace('ABC', '')
    print(num)

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':
    # We have a string S of length N consisting of uppercase English letters.
    temp = input().split('\n')
    n = temp[0]
    s = temp[1]
    num = 0
    if 'ABC' in s:
        num += 1
        s.replace('ABC', '')
    print(num)

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
count = 0

for i in range(len(s-2)):
    if s[i,i+2] == abc:
        count += 1

print(count)

Submission status: Runtime Error

Solution code:
import re

input()
print(len(re.findall('ABC', input()))

Submission status: Runtime Error

Solution code:
import re

input()
print(len(re.findall(input(), 'ABC'))

Submission status: Runtime Error

Solution code:
N = int(input())
S = str(input())
 
__DEBUG__ = False
 
def main():
    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
    return count
 
    
if __name__ == '__main__':
  print(main())

Submission status: Runtime Error

Solution code:
N = int(input())
S = str(input())
 
__DEBUG__ = False
 
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
    return count
 
    
if __name__ == '__main__':
  	import sys, threading
  	sys.setrecursionlimit(200000)
    threading.stack_size(10240000)
    print(solution())

Submission status: Runtime Error

Solution code:
def read_int(): return int(input())
N = read_int()
def read_str(): return input().strip()
S = list(read_str())
 
__DEBUG__ = False
 
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
    return count
 
    
if __name__ == '__main__':
  	import sys, threading
  	sys.setrecursionlimit(200000)
    threading.stack_size(10240000)
    print(solution())

Submission status: Runtime Error

Solution code:
def read_int(): return int(input())
N = read_int()
def read_str(): return input().strip()
S = list(read_str())
 
__DEBUG__ = False
 
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
    return count
 
    
if __name__ == '__main__':
  	import sys
  	sys.setrecursionlimit(200000)
    print(solution())

Submission status: Runtime Error

Solution code:
N= int(input())
M= input()
print(M.find("ABC")

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
ctr = ptr = 0

def count_ABC(pos, count):
    if (S[pos]=='A' and S[pos+1]=='B' and S[pos+2]=='C'):
        count += 1
        pos += 3
    else :
        pos += 1
    
    return(pos, count)

while (ptr <= (N-2)):
    ptr, ctr = count_ABC(ptr, ctr)

print(ctr)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 14 09:20:52 2020

@author: zkwbl7u
"""

def read_int(): return int(input())
N = read_int()
def read_str(): return input().strip()
S = list(read_str())

__DEBUG__ = False

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
    return count

    
if __name__ == '__main__':
    print(solution())

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(): return input().strip()
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()
    # print(f"N = {N}")
    S = list(read_str())
    # print(f"S = {S}")
    

@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
    return count

    
if __name__ == '__main__':
    solution()

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(): return input().strip()
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()
    # print(f"N = {N}")
    S = list(read_str())
    # print(f"S = {S}")
    

@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()