int input int input for in range while if if 10 else else print

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
n = int(input())
a = [int(input()) for i in range(n)]
l = 0
i = 0
j = 6
while i < (n - 6):
if j < n:
if (a[i] * a[j]) % 10 == 3:
j += 1
l += 1
else: j += 1
else:
i += 1
j = i + 6
print(l)