int input k1131 k1132 kc for in range int input append if in False k11

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
n = int(input())
k1131 = 0
k1132 = 0
kc = 0
b = [0]*5
for i in range(n):
a = int(input())
b.append(a)
if (0 in b) == False:
k1131 += k1131
c = b[0]; kc += 1
b.pop(0)
if c % 113 == 0:
k1131 += 1
elif a % 113 == 0:
k1132 += kc
else:
b.pop(0)
print(k1131 + k1132)