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=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)    


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)    


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)    


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


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)    


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)


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)


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)


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)    


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)    


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)


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)    


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)


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)    


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)


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)    


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)    


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)


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


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted