#1
def fill_list():
a = list()
for i in range(10):
a.append(int(input()))
a = list(filter(lambda x: x % 10 == 4, a))
return sum(a)/len(a)
print(fill_list())
#2
def fill_list():
a = list()
for i in range(10):
a.append(int(input()))
a = list(filter(lambda x: x % 2 == 0, a))
return sum(a)/len(a)
print(fill_list())