import java.math.BigInteger

private fun readStrings() = readLine()!!.split(" ")
private fun readInts() = readStrings().map { it.toInt() }

fun main(args: Array<String>) {
    val N = readInts()[0]
    val a = readInts()
    val bigA = a.map { BigInteger.valueOf(it.toLong())!! }
    val p = bigA.reduce { i1, i2 -> i1.multiply(i2) }
    val q = p.minus(BigInteger.valueOf(1))
    val ans = bigA.map { q.mod(it) }.reduce { i1, i2 -> i1 + i2 }
    println(ans.toString(10))
}