let () =
  let n1 = read_int () and
      n2 = read_int () and
      n3 = read_int () and
      n4 = read_int () and
      n5 = read_int () in
  let n = if n1 > n2 then n2 else n1 in
  let pasta = if n > n3 then n3 else n and
      juice = if n4 > n5 then n5 else n4 in
  Printf.printf "%d\n" (pasta+juice-50)
;;