program prob3
    implicit none
    integer::n, i
    integer, allocatable::a(:)
    integer(16)::ans, tmp, t
    read(*,*) n
    allocate(a(n))
    read(*,*) a
    ans = 0
    do i = 1, n
        ans = ans + a(i) - 1
    end do
    write(*,*) ans
    stop
contains
    function gcd(x,y) result(z)
        implicit none
        integer::x, y, z, i, a, b, c
        a = y
        b = x
        do while(mod(a,b) > 0)
            c = mod(a,b)
            a = b
            b = c
        end do
        z = b
    end function
end program