object Main {
  def main(args: Array[String]): Unit = {
    solve
  }

  def solve(): Unit = {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt
    val a = new Array[Long](n)
    for (i <- 0 until n) {
      a(i) = sc.nextLong
    }

    val m = a.foldLeft(1L)((z, v) => z * v) - 1
    val ans = a.map(m % _).sum
    println(ans)
  }
}
