object Main extends App{
  override def main(args:Array[String])={
    var count:Long = 1
    var n = readInt
    var a = readLine.split(" ").map(a=>a.toInt)
    for(i <- 0 until n){
      count *= a(i)
    }
    count-=1
    var res:Long=0
    for(i <- 0 until n){
      res+=(count%a(i))
    }
    println(res)
  }
}