b = list(map(int,input().split()))
d = []
j = 0
x = 0
for i in range(len(b)) :
x = 0
for j in range(len(d)):
if b[i] >= d[j]:
x += 1
elif x > 0:
break
else:
j = 0
break
d = d[x:]
d.append(b[i])
d.sort()
print(len(d))