Help : WA in CENS20C Cherry and Pyramid

https://ideone.com/QlDj2M
can anyone tell me the issue in this tiny code?
try:
a=input()
b=input()
for i in range(int(input())):
v=int(input())
a1=a*int(v/2)
a1=a1[:v]
print(a1.count(b))
except:
pass
Thank’s in advance!