Срочно Python!!!! Помогите
a = []
m, k = 0, 0
while True:
x = int(input())
if x == 0:
break
a.append(x)
if x > m:
m = x
for i in range(len(a)):
if a[i] == m:
k += 1
print(k)