burger1 = int(input())
burger2 = int(input())
burger3 = int(input())
drink1 = int(input())
drink2 = int(input())
burgers = [burger1, burger2, burger3]
drinks = [drink1, drink2]
rlt =[]
for drink in drinks:
for burger in burgers:
rlt.append(drink+burger-50)
print(min(rlt))