import scala.math.{min,max}

object Main {
  val sc = new java.util.Scanner(System.in)
  def main(args: Array[String]) {
    val r = (1 to 10).map(_ => sc.nextInt)
    println(r(0) - r.tail.sum)
  }
}