# a=input()
# stack=[]
# for i in range(len(a)):
# if a[i]=='(':
# stack.append(a[i])
# elif a[i]==')':
# if len(stack)==0:
# print("bad")
# exit()
# else:
# stack.pop()
# # 1. 스택이 비어있지 않아서, pop을 하는 경우
# # 2. 스택이 비어있어서 pop을 못하고 bad, 프로그램 종료exit()
# if stack.count('(') == stack.count(')'):
# print("good")
# else:
# print("bad")
list=[]
tot=0
for i in range(6):
a=int(input())
list.append(a)
for j in range(6):
if list[5]<list[j]:
tot=tot+1
print(tot+1)



