# 햄버거, 음료를 따로 list로 받기 h = [int(input()) for _ in range(3)] d = [int(input()) for _ in range(2)] print(min(h)+min(d)-50)