fun main(args: Array<String>) {

    val numN = readLine()!!.toInt()
    val aList = readLine()!!.split(" ").map(String::toInt).toMutableList()

    var p = 1L
    aList.forEach {
        p *= it
    }

    println(funM(aList,p - 1))

}

fun funM(aList:MutableList<Int>,m:Long):Long{
    var result = 0L
    aList.forEach {
        result += m % it
    }
    return result
}