TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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)?

Submission attempts (in order):
s = str(input())
print(s.count("ABC"))

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

Verdicts: Wrong Answer

Accepted
Problem: 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)?

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

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)

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
#abc144_b
S = input()
print(S.count("ABC"))

#abc144_b
N = int(input())
S = input()
print(S.count("ABC"))

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
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)

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):
    print(i)
    if s[i] == 'A':
        if s[i+1] == 'B':
            if s[i+2] == 'C':
                counter += 1
print(counter)

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 s[i+2] == 'C':
                counter += 1
print(counter)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
N = int(input())
S = str(input())

import math
ans = 0

for i in range(math.ceil(len(S)/3)):
    if S[i:i+3] == "ABC":
        ans += 1
    else:
        pass
print(ans)

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

import math
ans = 0

for i in range(math.ceil(len(S)/3)):
    print(S[i:i+3])
    if S[i:i+3] == "ABC":
        ans += 1
    else:
        pass
print(ans)

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

ans = 0

for i in range(len(S) - 2):
    #print(S[i:i+3])
    if S[i:i+3] == "ABC":
        ans += 1
    else:
        pass
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
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)

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
    if s[i] == 'A' and s[i + 1] == 'B' and s[i + 2] == 'C':
        count += 1

print(count)


Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
n = input()
print(inpur().count("ABC"))

n = input()
print(input().count("ABC"))


Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
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)

n = input()
s = input()
print(s.count('ABC') )
  

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
S = input()

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)


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)

N = input()
S = input()

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)


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
x = input()
print(x.count("ABC"))

x = input()
x = input()
print(x.count("ABC"))

Verdicts: Wrong Answer

Accepted
Problem: 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)?

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

N = int(input())
S = str(input())
print(S.count("ABC"))

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
n,s = input().split()
print(s.count('ABC'))

n = input()
s = input()
print(s.count('ABC'))

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
S = input()

print(S.count("ABC"))

N = input()
S = input()

print(S.count("ABC"))

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
s=list(input())
num=0
if n<3:
    exit()
for i in range(n):
    if (s[i]=="A") and (s[i+1]=="B") and (s[i+2]=="C"):
        num+=1
print(num)


n=int(input())
s=list(input())
num=0
if n<3:
    exit()
for i in range(n-2):
    if (s[i]=="A") and (s[i+1]=="B") and (s[i+2]=="C"):
        num+=1
print(num)


Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
n = int(input)
s = input()
s2 = s.replace("ABC","")
print(int((len(s)-len(s2))/3))

n = int(input())
s = input()
s2 = s.replace("ABC","")
print(int((len(s)-len(s2))/3))

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
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)

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)

N = int(input())
S = str(input())
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)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
a,b=input().split("\n")
print(len(b.split("ABC"))-1)

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

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

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

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

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

a = input()
a = input()
print(a.count("ABC"))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):

N= int(input())

A= []
s= input()
A= list(s)


print(A)

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

print(add)


N= int(input())
s= input()

A= []
A= list(s)

#print(A)

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

print(add)

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
N = int(input())
S = [i for i in range(N)]
cnt = 0

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

print(cnt)

N = int(input())
S = input()
S = [i for i in S]
cnt = 0

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

print(cnt)

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
N = int(input())
S = str(input())

S.count('ABC')

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

print(S.count('ABC'))

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
input = input()
result = 0
for i in range(len(input) - 2):
    serach = input[i:i+3]
    if serach == "ABC":
        result += 1
console.log(result)

input = input()
result = 0
for i in range(len(input) - 2):
    serach = input[i:i+3]
    if serach == "ABC":
        result += 1
print(result)

num = input()
input = input()
result = 0
for i in range(len(input) - 2):
    serach = input[i:i+3]
    if serach == "ABC":
        result += 1
print(result)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
#ABC144 B
N=int(input())
S=input()
#print(N)
result=0

for i in range(N-1):
    if S[i]=="A" and S[i+1]=="B" and S[i+2]=="C":
        print(i)
        result+=1
    else:
        print("after"+str(i))
        p=1

print(result)

#ABC144 B
N=int(input())
S=input()
#print(N)
result=0

for i in range(N-2):
    if S[i]=="A" and S[i+1]=="B" and S[i+2]=="C":
        #print(i)
        result+=1
    else:
        #print("after"+str(i))
        p=1

print(result)

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
def main():
    N, S = open(0).read().split('\n')
    print(S.count('ABC'))


if __name__ == '__main__':
    main()


def main():
    N = input()
    S = input()
    print(S.count('ABC'))


if __name__ == '__main__':
    main()


Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
n = int(input())
s = input()

count = 0
flag = 0
for ch in s:
  if ch=='A' and flag==0:
    flag = 1
  else:
    flag = 0
  if ch=='B' and flag==1:
    flag = 2
  else:
    flag = 0
  if ch=='C' and flag==2
  	flag = 3
  else: flag = 0
  if flag==3:
    count += 1
    flag = 0

print(count)

n = int(input())
s = list(input())
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)

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
n = input()
w = input()
w.count('ABC')

input()
w = input()
print(w.count('ABC'))

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
S = input()
print(S.count("ABC"))

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

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
N=input()
print(input().count("ABC")

print(input().count("ABC"))

N=input()
print(input().count("ABC"))

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
N = int(input())
S = input()
for i in range(N):
    if S[i]+S[i+1]+S[i+2] == 'ABC':
        a += 1
    if i == N - 3:
        break
print(a)


N = int(input())
S = str(input())
for i in range(N):
    if S[i]+S[i+1]+S[i+2] == 'ABC':
        a += 1
    if i == N - 3:
        break
print(a)

N = int(input())
S = input()
a = 0
for i in range(N):
    if S[i]+S[i+1]+S[i+2] == 'ABC':
        a += 1
    if i == N - 3:
        break
print(a)



Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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)?

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

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

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
n = int(input());
s = input();

ans = 0;

for i in range(len(s)):
  3_str = s[i:i+2];
  ans += int(3_str == "ABC");

print(ans);

n = int(input());
s = input();

ans = 0;

for i in range(n):
  three = s[i:i+3];
  ans += int(three == "ABC");

print(ans);

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
n = input()
s = input()
print(s.count("ABC")

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

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
a = int(input())
b = input()
c = list(b)
for i  in range(a - 2):
    j = 0
    if c[i] == 'A' and c[i + 1] == 'B' and c[i + 2] == 'C':
        j = j + 1
print(j)

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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
n = input()
s = input()
s.count('ABC')

n = input()
s = input()
print(s.count('ABC'))

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
n = int(input())
s = input()
print(s.count('abc'))

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

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
N = int(input())
s = input()
a=0
for i in range (1,N-2):
  if s[i:i+2]=="ABC":
    a +=1
print(a)


N = int(input())
s = input()
a=0
for i in range N-2:
  if s[i:i+2]=="ABC":
    a +=1
print(a)

N = int(input())
s = input()
a=0
for i in range (0,N-2):
  if s[i:i+3]=="ABC":
    a +=1
print(a)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
num = int(input())
a= input()
words = a.split()
ss = 0

for i in range(num):
  if "A" = words[i]:
    for q in range(i,num):
      if "B" = words[q]:
        for g in range(q,num):
          if "C" = words[g]:
            ss += 1
          
  

num = int(input())
s=list(input())
ss = 0

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


Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
str_len = int(input())
string_sample = input()
sample = 'ABC'

counter = 0
for i in range(str_len - 2):
  print(i)
  if string_sample[i:i+3] == sample:
    counter += 1
    
print(counter)

str_len = int(input())
string_sample = input()
sample = 'ABC'

counter = 0
for i in range(str_len - 2):
  if string_sample[i:i+3] == sample:
    counter += 1
    
print(counter)

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
N = int(input())
words = input()
ans = 0
for i in range(N-4):
    if words[i] == "A":
        if words[i+1] == "B":
            if words[i+2] == "C":
                ans += 1
print(ans)

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

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
n,s=input().split()

print(s.count('ABC'))

n=input()
s=input()

print(s.count('ABC'))

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
N = int(input())
S = input()
print(S.count("ABC")


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

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
input()

S = input()

print(sorted(S).count("ABC"))

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

c = S.count("ABC")
print(c)


Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
n = int(input())
s = list(str(input()))
ans = s.count('ABC')
print(ans)

n = int(input())
s = input()
ans = s.count('ABC')
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
import sys

def main():
    N = int(input().split())
    S = input()

    cnt = 0
    for i in range(N):
        s = str(S[i]) + str(S[i+1]) + str(S[i+2])
        if s=='ABC':
            cnt += 1

    print(cnt)
main()

import sys

def main():
    N = int(input().split())
    S = input()

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

    print(cnt)
main()

import sys

def main():
    N = int(input())
    S = input()

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

    print(cnt)
main()

import sys

def main():
    N = int(input().split())
    S = input()

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

    print(cnt)
main()

import sys

def main():
    N = int(input())
    S = input()

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

    print(cnt)
main()

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
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)

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)

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)
    

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
a = input()
print(a.count('ABC'))

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


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


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
n = int(input())
letters = input()
cnt = 0
for i in range(n):
    if letters[i:i+3]=="abc":
        cnt += 1

print(cnt)

n = int(input())
letters = input()
cnt = 0
for i in range(n):
    if letters[i:i+3]=="ABC":
        cnt += 1

print(cnt)

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
N = int(input())
s = input()
print(s.count("abc"))

N = int(input())
s = input()
print(s.count("ABC"))

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
s = str(input())
n = int(input())
print(s.count('ABC')) if len(s)==n

s, n = input().split()
print(s.count('ABC'))

s = str(input())
n = int(input())
s.upper()
print(s.count('ABC')) if len(s)==n

N = int(input())
S = str(input())
print(S.count("ABC"))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
n=int(input())
s=input()

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

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

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
N = int(input())
S = input()

cnt = 0
ans = 0
print(S)
for i in S:
	if S[cnt] == "A":
		if S[cnt:cnt+3] == "ABC":
			ans += 1
	cnt += 1
	if N - 3 == cnt:
		break

print(ans)

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

cnt = 0
ans = 0
print(S)
for i in S:
	if S[cnt] == "A":
		if S[cnt:cnt+3] == "ABC":
			ans += 1
	cnt += 1
	if N - 3 == cnt:
		break

print(ans)

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

cnt = 0
ans = 0
print(S)
for i in S:
	if S[cnt:cnt+3] == "ABC":
		ans += 1
	cnt += 1
	if cnt == (N - 3):
		break
print(ans)

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

cnt = 0
ans = 0
for i in S:
	if S[cnt:cnt+3] == "ABC":
		ans += 1
	cnt += 1
	if cnt == (N - 3):
		if S[cnt:cnt+3] == "ABC":
			ans += 1
		break
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
text = input().split("ABC")
print(len(text)-1)

input()
text = input().split("ABC")
print(len(text)-1)


Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
from functools import lru_cache
import sys

sys.setrecursionlimit(10**8)

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

@lru_cache(maxsize=None)
def dp(s):
    print(s.count("ABC"))
print(dp(S))



from functools import lru_cache
import sys

sys.setrecursionlimit(10**8)

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

@lru_cache(maxsize=None)
def dp(s):
    result = s.count("ABC")
    return result
print(dp(S))



Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
N = int(input())
S = input()

ans = 0

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

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

ans = 0

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

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
a = input()
s = input()
print(s.count("ABC")

a = input()
s = input()
print(s.count("ABC"))

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
N = int(input())
S = list(input())
cnt = 0
for i in range(i,N-2):
    if S[i] ='A' and S[i+1] == 'B' and S[i+2] == 'C':
        cnt += 1

print(cnt)

N = int(input())
S = list(input())
cnt = 0
for i in range(0,N-2):
    if S[i] =='A' and S[i+1] == 'B' and S[i+2] == 'C':
        cnt += 1

print(cnt)

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
a = input()
b = input()
print(b.count("abc"))

a = input()
b = input()
print(b.count("ABC"))

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
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)

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)


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

if

def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

n = i()
s = s()

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

print(cnt)

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
n=int(input())
x=input()
x.count("ABC")

n=int(input())
x=input()
y=x.count("ABC")
print(y)

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
N=list(input())
ans=0
for i in range(len(N)-2):
  if N[i]=='A':
    if N[i+1]=='B':
      if N[i+2]=='C':
        ans=ans+1
print(N)        

M=int(input())
N=list(input())
ans=0
for i in range(len(N)-2):
  if N[i]=='A':
    if N[i+1]=='B':
      if N[i+2]=='C':
        ans=ans+1
print(ans)        

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
N=int(input())
S=input()
print(S.count("abc"))

N=int(input())
S=input()
print(S.count("abc",0,N))

N,S=input()
print(S.count("abc"))

N=int(input())
S=input()
print(S.count("ABC",0,N))

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
n,s = [int(input()) for _ in range(2))
print(s.count("ABC"))

n,s = [input() for _ in range(2)]
print(s.count("ABC"))

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
def resolve():
    _, S = [input() for i in range(2)]

    print(S.count('abc'))


if __name__ == "__main__":
    resolve()

def resolve():
    _, S = [input() for i in range(2)]

    print(S.count('abc') + S.count('ABC'))


if __name__ == "__main__":
    resolve()

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
n = int(input())
s = str(inout())
print(s.count('ABC'))

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

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
n = int(input())                                                                    s = input()                                                                                                                                                             print(s.count('ABC'))

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

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
_ = input()
S = input()
print(len(S.split("ABC") - 1))

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

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
n = int(input())
s = input()

count = 0
for i in range(n-2):
  print(s[i:i+3])
  if s[i:i+3] == 'ABC':
    count += 1
print(count)

n = int(input())
s = input()

count = 0
for i in range(n-2):
  if s[i:i+3] == 'ABC':
    count += 1
print(count)

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
N=int(input())
S=str(input())

list=[]

for i in range(N-1):
    if S[i]=='a' and S[i+1]=='b' and S[i+2]=='c':
        list.append(i)
print(len(list))

N = int(input())
S = input()
cnt = 0

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

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
N=input()
S=input()

S.replace('ABC','x')
print(S.count('x'))

N=input()
S=input()

ans=S.replace('ABC','x')
print(ans.count('x'))

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
n=int(input())
count=0
s=input()
for i in s:
  if i=="ABC":
    count+=1  
print(count)

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

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
N = int(input())
S = input()

count = 0
for i in range(N-3):
  if S[i]S[i+1]S[i+2] == ABC:
    count = +1
  else:
    continue
print(count)

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


#print(S.split("ABC"))
print(len(S.split("ABC")) - 1)



Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
n=int(input())
s=input()
s.replace('ABC','a')
print(s.count('a'))

n=int(input())
s=input()
s.replace('ABC','a2c')
print(s.count('a2c'))

n=int(input())
s=input()
t=s.replace('ABC','c')
print(t.count('a'))

n=int(input())
s=input()
t=s.replace('ABC','a')
print(t.count('a'))

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
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)

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

print(S.count("ABC"))

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
N = int(input())
S = input()
acs = 65
count=0
flag=0

if N>=3 and N<=50:
    if len(S) == N:
        for i in S:
            if ord(i) == acs:
                acs+=1
                count+=1
            else:
                acs=65
                if count==3:
                    flag+=1
                count=0

print(flag)
            


N = int(input())
S = str(input())
print(S.count("ABC"))

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
n = int(input())
s = input()
print(s.count('ABC')

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

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
N = int(input())
S = input()
c = 0
for i in range(N-2):
  if S[i:i+3]=="ABC":
    c += 0
print(c)

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



Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
s = input()
N = len(s)
ans = 0
if N < 3:print(0);exit()
i = 0
while i < N-3:
  if s[i:i+3] == 'ABC':ans += 1;i += 3
  else:i+=1

print(ans)


s = input()
N = len(s)
ans = 0
if N < 3:print(0);exit()
for i in range(N-3):
  if s[i:i+3] == 'ABC':ans += 1

print(ans)

s = input()
N = len(s)
ans = 0
if N < 3:print(0);exit()
for i in range(N-2):
  if s[i]=='A' and s[i+1]=='B' and s[i+2] == 'C':ans += 1

print(ans)


s = input()
N = len(s)
ans = 0
for i in range(N-2):
  if s[i:i+3] == 'ABC':ans += 1

print(ans)


N = int(input())
s = input()
ans = 0
if N < 3:print(0);exit()
for i in range(N-2):
  if s[i:i+3] == 'ABC':ans += 1

print(ans)


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
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)

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)

total = int(input())
text = input()

res = 0

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

print(res)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
int N = input()
String S = input()
print(s.count('ABC'))

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

N = input()
S = input()
print(S.count('ABC'))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
N = int(input())
S = input()
cut = 0
for n in range(N+1):
    if S[n] == 'A' and S[n + 1] == 'B' and S[n + 2] == 'C':
        cut += 1

print(cut)

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

cnt = 0

for n in range(N-2):
    if S[n] == 'A' and S[n+1] == 'B' and S[n+2] == 'C':
        cnt += 1
print(cnt)

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):

S = str(input())
print(S.count("ABC"))


N = int(input())
S = str(input())
print(S.count("ABC"))


Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
n=input()
s=input()
print(s.count('abc'))

n=input()
s=input()
print(s.count('ABC'))

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
N=int(input())
S=input()
print(sum(S[i]==A and S[i+1]==B and S[i+2]==C for i in range(N-2)))    

N=int(input())
S=input()
print(sum(S[i]=='A' and S[i+1]=='B' and S[i+2]=='C' for i in range(N-2)))

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
print(len(input().split("ABC")) - 1)

print(len(input().split("ABC")))

n = input()
print(len(input().split("ABC")) - 1)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
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)


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


Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
def main():
    n = int(input())
    s = input()

    prev = ''
    c = 0

    for i in s:
        if prev == '':
            if i == 'A':
                prev = 'A'
        elif prev == 'A':
            if i == 'A':
                pass
            elif i == 'A':
                prev = 'B'
            else:
                i == ''
        elif prev == 'B':
            if i == 'A':
                prev = 'A'
            elif i == 'C':
                c += 1
                prev = ''
            else:
                prev = ''

    print(c)


if __name__ == '__main__':
    main()


def main():
    n = int(input())
    s = input()

    prev = ''
    c = 0

    for i in s:
        if prev == '':
            if i == 'A':
                prev = 'A'
        elif prev == 'A':
            if i == 'A':
                prev = 'A'
            elif i == 'B':
                prev = 'B'
            else:
                prev = ''
        elif prev == 'B':
            if i == 'A':
                prev = 'A'
            elif i == 'C':
                c += 1
                prev = ''
            else:
                prev = ''

    print(c)


if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
N=int(input())
S=input()
ans=0
for i in range (0,n-2):
  if S[i]=="A" and S[i+1]=="B" and S[i+2]=="C":
    ans+=1
print(ans)

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

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
n = int(input())
s = input()
s2 = "ABC"
print(n.count(s2))

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)


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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
n = int(input())
s = input()
count = 0

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

print(count)

n = int(input())
s = input()
count = 0

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

print(count)

n = int(input())
s = input()
count = 0

for i in range(n-2):
    if s[i]+s[i+1]+s[i+2] == 'ABC':
        count += 1

print(count)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
input()
s = input()
l = len(s)
s.replace('ABC', '')

l2 = len(s)

print(l-l2 // 3)

input()
s = input()
l = len(s)
s.replace('ABC', '')
 
l2 = len(s)
 
print((l-l2) // 3)

input()
s = input()
l = len(s)
s2 = s.replace('ABC', '')
 
l2 = len(s2)
 
print((l-l2) // 3)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
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)      

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)      

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)      

S = input()
print(S.count("ABC"))

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)

    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)      

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)      

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)

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted