p1 = gets.to_i
p2 = gets.to_i
p3 = gets.to_i
j1 = gets.to_i
j2 = gets.to_i

min = 10**4
[p1, p2, p3].each do |pasta|
    [j1,j2].each do |ju|
        price = pasta + ju - 50
        min = price if price < min
    end
end
puts min
