import scala.math.{min,max}

object Main {
  val sc = new java.util.Scanner(System.in)
  def main(args: Array[String]) {
    val pa = List(sc.nextInt, sc.nextInt, sc.nextInt)
    val ju = List(sc.nextInt, sc.nextInt)
    var m = 10000
    for(i <- 0 until 3; j <- 0 until 2) {
      m = min(m, pa(i) + ju(j) - 50)
    }
    println(m)
  }
}