import scala.io.StdIn.{readInt,readLine}

object Main {
  def main(args:Array[String]) = {
    val n = for(i<-1 to 5) yield readInt
    val m = if(n(0)>n(1)) n(1) else n(0)
    val pasta = if(m>n(2)) n(2) else m
    val juice = if(n(3)>n(4)) n(4) else n(3)
    println(pasta+juice-50)
  }
}