Problem:
 Score : 300 points    Problem Statement You are given N positive integers a_1, a_2, ..., a_N .  For a non-negative integer m , let f(m) = (m\ mod\ a_1) + (m\ mod\ a_2) + ... + (m\ mod\ a_N) .  Here, X\ mod\ Y denotes the remainder of the division of X by Y .  Find the maximum value of f .      Constraints  All values in input are integers.  2 \leq N \leq 3000  2 \leq a_i \leq 10^5         Input Input is given from Standard Input in the following format:  N  a_1  a_2  ...  a_N       Output Print the maximum value of f .        Sample Input 1 3
3 4 6      Sample Output 1 10  f(11) = (11\ mod\ 3) + (11\ mod\ 4) + (11\ mod\ 6) = 10 is the maximum value of f .       Sample Input 2 5
7 46 11 20 11      Sample Output 2 90       Sample Input 3 7
994 518 941 851 647 2 581      Sample Output 3 4527

Solution (Python):
from functools import reduce

n = int(input())
a = list(map(int, input().split()))

def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)


a_lcm = reduce(lambda x, y: (x * y) // gcd(x, y), a)
m = a_lcm - 1
a_mod = [m % ax for ax in a]

print(sum(a_mod))

Solution (Python):
n = int(input())
nums = list(map(int, input().split()))
print(sum(nums) - n)

Solution (Python):
def main():
    n = int(input())
    a = [int(x) for x in input().split()]

    f = sum(x - 1 for x in a)
    print(f)

main()

Solution (Python):
n = int(input())
l = list(map(int,input().split()))

cnt=0
f=0
for i in l:
    f += i-1
print(f)

Solution (Python):
import sys

N = int(sys.stdin.readline().strip())
a = [ i - 1 for i in map(int, sys.stdin.readline().strip().split())]

print(sum(a))

Solution (Python):
N = int(input())
lis = list(map(int,input().split()))

m = 0
for j in range(N):
   m += lis[j] - 1

print(m)

Solution (Python):



N = int(input())
A = list(map(int, input().split()))

print(sum(A)-N)

Solution (Python):
N = input()
a = list(map(int, input().split()))

summ = 1
for i in a:
    summ *= i

summ2 = 0
for i in a:
    summ2 += (summ-1)% i

print(summ2)

Solution (Python):
n=int(input())
a=[int(i) for i in input().split()]
s=0
for i in range(0,n):
    s+=(a[i]-1)
print(s)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
f=0
from fractions import gcd
from functools import reduce



def lcm(x, y):
    return (x * y) // gcd(x, y)


def lcm_list(*numbers):
    return reduce(lcm, numbers)
a_lcm=lcm_list(*a)
a_lcm=a_lcm-1
for i in range(n):
    f+=a_lcm % a[i]
print(f)

Solution (Python):
N = int(input())
As = list(map(int, input().split()))

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def lcm(a, b):
    return a * b // gcd(a, b)


m = 1
for A in As:
    m = lcm(m, A)

ans = 0
for A in As:
    ans += (m-1) % A

print(ans)

Solution (Python):
n = int(input())
nums = list(map(int, input().split()))

print(sum(nums)-n)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(n):
    m = a[i] - 1
    ans += m
print(ans)

Solution (Python):


def main():
    n = int(input())
    a_list = list(map(int, input().split()))

    a_list = map(lambda x: x - 1, a_list)
    print(sum(list(a_list)))


    
if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
a = []
for i in input().split():
  a.append(int(i))
ans = 0
for i in a:
  ans+=(i-1)
print(ans)

Solution (Python):








n = int(input())
a = map(int,input().split(' '))
print(sum(a) - n)

Solution (Python):
def main():
    """
    2 <=  N <= 10^3
    2 <= ai <= 10^5

    非負整数 m に対して
    f(m) = (m mod a1) + (m mod a2) + (m mod aN)
    f_max

    mの制約は問題文中には直接記述されていない
    """
    N = int(input())
    *A, = map(int, input().split())

    ans = f(N, A)
    print(ans)


def f(N, A):
    """
    直感: 最小公倍数,最大公約数
        最小公倍数のm ならすべてのaで割り切れる
        つまり最小公倍数-1 ならすべてのaについて m mod ai = ai - 1

    m=a_MAX-1, (m mod a_MAX) が最大
    ただし他のa=a_MAX-1 の場合、f(m)は小さくなってしまう
    aiに対して1 <= m <= a_Max-1 をすべて試す: 10^5 * 3 * 10^3 => TLE
    """
    try:
        
        from math import gcd
    except:
        from fractions import gcd

    def lcm(x, y):
        return x * y // gcd(x, y)

    m1 = lcm(A[0], A[1])
    for a in A[2:]:
        m1 = lcm(m1, a)

    m = m1 - 1
    ans = sum(m % a for a in A)

    return ans


def WA(N, A):
    ans = 0
    m_max = max(A) * 2 - 1
    for m in range(1, m_max):
        mods = [m % a for a in A]
        tmp = sum(mods)
        print(*(mods + [tmp]), sep="\t")
        ans = max(ans, tmp)

    return ans


if __name__ == '__main__':
    main()

Solution (Python):



N = int(input())
A = [int(i) - 1 for i in input().split()]

print(sum(A))

Solution (Python):
n=input()
a=[int(i) for i in input().split()]
ac=a[:]


def lcm(x, y):
    x2=x
    y2=y
    while y != 0:
        x, y = y, x%y
    return (x2 * y2) // x

while(len(ac)>1):
    x=ac.pop()
    y=ac.pop()
    ac.append(lcm(x, y))

g=ac[0]-1

ans=0
for i in a:
    ans+=g%i

print(ans)

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]

r = 0
for i in a:
    r += i - 1

print(r)

Solution (Python):
from functools import reduce

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def lcm_base(x, y):
    return (x*y)//gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n = int(input())
a = [int(i) for i in input().split()]

c = lcm_list(a)-1
print(sum([c % b for b in a]))

Solution (Python):
kick=input()
inp=input().split()
b=False
sum=0
for i in inp:
    i=int(i)
    sum+=(i-1)
print(sum)

Solution (Python):


def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def lcm(a,b):
    g = gcd(a,b)
    return  a*b//g

def lcm_n(arr):
    l = arr[0]
    for i in range(len(arr)-1):
        l = lcm(l,arr[i+1])
    return l

N = int(input())
arr = list(map(int,input().split()))

g = lcm_n(arr)-1
out = 0


for i in arr:
    out += g%i

print(out)

Solution (Python):
import sys,collections,math;sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

n = I()
a = Is()
m = 1
for e in a:
    m = m*e
m -= 1
f = 0
for e in a:
    f += m%e
print(f)

Solution (Python):
n = int(input())
A = list(map(int,input().split()))

res = 0
for a in A:
    res += a-1

print(res)

Solution (Python):

n = input()
l = input().split()
sum = 0
for i in range(len(l)):
	sum += int(l[i])-1
print(sum)

Solution (Python):
N =int(input())
a = list(map(int, input().strip().split(' ')))
ans=0
for i in range (len(a)):
    ans+=a[i]-1
print(ans)

Solution (Python):
import math

N = int(input())
a = [int(i) for i in input().split()]

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def lcm(x, y):
    return (x * y) // gcd(x, y)

koubai = 1
for i in range(N):
    koubai = lcm(koubai, a[i])







ans = 0
for i in range(N):
    ans += (koubai-1) % a[i]

print(ans)

Solution (Python):


N = int(input())
an = list(map(int, input().split()))

sum = 0
for i in range(N):
    sum += an[i] -1

print(sum)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
wa = 0
for i in range(n):
    wa += a[i]
print(wa - n)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))

ans = sum(a)-n

print(ans)

Solution (Python):

N=int(input())
A=list(map(int,input().split()))

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def lcm(x, y):
    return (x * y) // gcd(x, y)

j=lcm(A[0],A[1])
for i in range(2,len(A)):
    j=lcm(j, A[i])

tmp=[]
for i in A:
    tmp.append((j-1)%i)
ans=sum(tmp)
print(ans)

Solution (Python):

import math

n = int(input())
a = list(map(int, input().split()))

ret = 0
for i in a:
    ret += i - 1

print(ret)

Solution (Python):
from functools import reduce

def gcd(a, b):
  while b > 0:
    a, b = b, a%b
  return a

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n=int(input())
l=list(map(int,input().split()))

m=lcm_list(l)
f=0

for i in range(n):
  f+=(m-1)%l[i]
  
print(f)

Solution (Python):
import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(numbers):
    return reduce(lcm_base, numbers, 1)

N = int(input())
A = [int(i) for i in input().split()]

m = lcm(A) - 1
f = 0
for i in range(N):
    f += m % A[i]
print(f)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))

print(sum(a)-n)

Solution (Python):


N = int(input())
a = [int(i) for i in input().split()]

print(sum(a) - N)

Solution (Python):
n = int(input())
a = [0 for i in range(n)]
a_tmp = input().split()
for i in range(n):
    a[i] = int(a_tmp[i])
ans = 0
for i in range(n):
    ans += a[i] -1
print(ans)

Solution (Python):
import statistics
import math
import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n = int(input())
nums = list(map(int, input().split()))
lcm = lcm_list(nums)


sum =0
for num in nums:
    sum += (lcm-1)%num
print(sum)

Solution (Python):


n = int(input())
tmp = input()
a=[int(x) for x in tmp.split()]

print(sum(a)-n)

Solution (Python):
N = int(input())
a = [int(i) for i in input().split()]

modTotal = 0
for i in range(N):
    modTotal += a[i]-1
print(modTotal)

Solution (Python):




'''
S = input()
A, B = input().split()
'''


'''
S = list(input())
'''


'''
X, Y, Z = map(int, input().split())
X, Y, Z = list(map(int, input().split()))
'''


'''
L = ['a', 'a', 'b']
L = list(set(L))
'''


'''
L = [None] * N
'''


'''
import numpy as np

N = 3
f = []

for i in range(0, 2**N):
    string = str(bin(i))[2:]
    f.append(['0'] * (N - len(string)) + list(string))

F = np.array(f)
F = (F == '1')
'''

import fractions
from functools import reduce


def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(numbers):
    return reduce(lcm_base, numbers, 1)


N = int(input())
A = list(map(int, input().split()))
L = lcm(A) - 1

result = 0

for a in A:
    result += (L % a)

print(result)

Solution (Python):
aaa = input()
sa = list(map(int,input().split()))
ans = 0
for i in sa:
    ans += (i-1)
print(ans)

Solution (Python):
def run():
	N = input()
	ls = [int(x) - 1 for x in input().split()]

	print(sum(ls))

if __name__ == '__main__':
	run()

Solution (Python):
def main():
    n = int(input())
    a = list(map(int,input().split()))

    sum = 0
    for alpha in a:
        sum = sum + alpha

    print(sum - n)


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
a =  map(int, input().split())

ans = 0
for i in a :
    ans = ans + i - 1

print(ans)

Solution (Python):
n = int(input())
a = list( map(int, input().split()) )	

from fractions import gcd

def lcm(a, b):
	return a * b // gcd (a, b)

x=1
for i in range(n):
	x = lcm(x, a[i])

m = x-1
ans=0
for i in range(n):
	ans += m % a[i]

print(ans)

Solution (Python):
n = int(input())
a = input()

total = 0
for i in range(n):
    total += int(a.split()[i])

total -= n

print(total)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
print(sum(a)-len(a))

Solution (Python):
N = int(input())
a = [int(x) for x in input().split()]


sum = 0
for x in a:
    sum += x-1

print(sum)

Solution (Python):
import functools

def gcd(a,b):
    while b > 0:
        a, b = b, a % b
    return a
    
def lcm(a, b):
    return a * b / gcd(a, b)

N = int(input())
a = list(map(int, input().split()))

lcmVal = int(functools.reduce(lcm, a, 0))
print(sum(map(lambda x: (lcmVal-1) % x, a)))

Solution (Python):
N = int(input())
ls_a= list(map(int, input().split(' ')))

result = 0
for i in range(N):
    result += ls_a[i] - 1

print(result)

Solution (Python):
n = int(input())
arr = list(map(int, input().split()))
lcm = 0
for e in arr:
    lcm += e - 1
print(lcm)

Solution (Python):
num = int(input())
numbers = list(map(int,input().split()))
ans = sum(numbers)-num
print(ans)

Solution (Python):
import math
n = int(input())
a = [i for i in map(int , input().split())]

print(sum(a)-n)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))

print(sum(a)-n)

Solution (Python):
N = int(input())
a = [int(x) for x in input().split()]
print(sum(a) - N)

Solution (Python):

N = int(input())
A = list(map(int,input().split()))

ans = 0

for a in A:
	ans += a -1
		
print(ans)

Solution (Python):
N = int(input())
a = list(map(int,input().split()))

print(sum(a)-N)

Solution (Python):
import fractions
from functools import reduce

N = int(input())
a =  list(map(int, input().split()))

def f(m, a):
    re = 0
    for i in a:
        re += m % i
    return re

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

m = lcm_list(a) - 1
print(f(m, a))

Solution (Python):
from functools import reduce

n = int(input())
a = [int(i) for i in input().split()]

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

c = lcm_list(a) - 1

f = 0
for i in a:
    f += c % i

print(f)

Solution (Python):

"""
Created on Sat Jul 21 19:19:13 2018
ABC103C
@author: maezawa
"""

n = int(input())
a = list(map(int, input().split()))

print(sum(a)-n)

Solution (Python):
import fractions
import functools
from operator import mul

n=int(input())
aas=list(map(int,input().split()))

def gcdmult(lis):
    return(functools.reduce(fractions.gcd,lis))

lcmmult = lambda x: (functools.reduce(mul,x))//gcdmult(x)
lcma = lcmmult(aas)

ans = sum(map(lambda x: (lcma-1)%x,aas))
print(ans)

Solution (Python):
N = int(input())
a = [int(i) for i in input().split()]

def get_gcd(a,b):
        if a<b:
                a,b = b,a

        if a%b == 0:
                return b
        else:
                return get_gcd(b,a%b)

def get_lcm(a,b):
        return a*b//get_gcd(a,b)

def get_lcm_list(numbers):
        ans = get_lcm(numbers[0],numbers[1])
        for i in range(2,len(numbers)):
                ans = get_lcm(ans,numbers[i])
        return ans

M = get_lcm_list(a)
print(sum([(M-1)%i for i in a]))

Solution (Python):


from functools import reduce

N = int(input())
aN = list(map(int, input().split()))

def gcd(a, b):
    while b > 0:
        a, b = b, a%b
    return a
def lcm_base(x, y):
    return (x * y) // gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

def f(num, aN):
    sum1 = 0
    for i in range(len(aN)):
        sum1 += num % aN[i]
    return sum1


lcm = lcm_list(aN)
print(f(lcm-1, aN))

Solution (Python):
N = int(raw_input())
A = [int(c) for c in raw_input().split()]

r = 0
for a in A:
    r += (a-1)
print r

Solution (Python):
import fractions

def lcm(a,b):
    return (a*b)//fractions.gcd(a,b)

n=int(input())
a=list(map(int,input().split()))
for i in range(n-1):    
    if(i==0):
        m=lcm(a[0],a[1])
    else:
        m=lcm(m,a[i+1])
m-=1
f=0
for i in range(n):
    f+=m%a[i]
print(f)

Solution (Python):
n = int(input())
t = input().split()
a = [int(i) for i in t]

print(sum(a) - n)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))

sum = 0
for i in a:
    sum += i-1
print(sum)

Solution (Python):


N = int(input())
a = list(map(int, input().split()))


f = 0
for i in a:
    f += i-1

print(f)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))

print(sum(a) - N)

Solution (Python):
N =int(input())
L = list(map(int, input().split()))
print(sum(L)-N)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
print(sum(a)-len(a))

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
ans = sum(a) - N
print(ans)

Solution (Python):
n=input()
w=[]
w=raw_input().split()
w=[int(x)for x in w]
s=1
for i in range(n):
    s=s*w[i]
s=s-1
t=0
for i in range(n):
   t+=s%w[i]
print t

Solution (Python):
n = input()
n_list = list(map(int, input().split()))

max_sum = 0

for num in n_list:
  max_sum += (num - 1)

print(max_sum)

Solution (Python):
N = int(input())
a = list(map(int,input().split()))
print(sum([i-1 for i in a]))

Solution (Python):
N=int(input())
A=list(map(int,input().split()))

X=0
for i in range(N):
    X+=A[i]-1

print(X)

Solution (Python):
import math
import functools
N = int(input())
T = [int(i) for i in input().split()]

def gcd(A, B):
  while(True):
    if A and B:
      if A > B:
        A = A % B
      else:
        B = B % A
    else:
      return max(A, B)

def lcm(A, B):
  return int(A * (B // gcd(A, B)))


x = functools.reduce(lcm, T) -1
ans = 0
for i in range(N):
    ans = ans + (x%T[i])
print(ans)

Solution (Python):
def find_lcm(num1, num2):
    if(num1>num2):
        num = num1
        den = num2
    else:
        num = num2
        den = num1
    rem = num % den
    while(rem != 0):
        num = den
        den = rem
        rem = num % den
    gcd = den
    lcm = int(int(num1 * num2)/int(gcd))
    return lcm
n=  int(raw_input())
arr = map(int, raw_input().split())
lc = find_lcm(arr[0], arr[1])
for i in range(2, n):
    lc = find_lcm(lc, arr[i])
lc -= 1
ans = 0
for i in xrange(n):
    ans += (lc % arr[i])
print ans

Solution (Python):
N = int(input())
print(sum(map(int, input().split())) - N)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
num = 0

for j in range(N):
    num += a[j] - 1

print(num)

Solution (Python):
from fractions import gcd
def lcm(a, b):return a * b // gcd(a,b)
N = int(input())
A = [int(i) for i in input().split()]
B = lcm(A[0],A[1])
ans = 0
for i in A:
    B = lcm(B,i)
for i in A:
    ans += (B-1)%i
print(ans)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))

for i in range(len(a)):
    a[i] -= 1
    
print(sum(a))

Solution (Python):
import fractions
N = int(input())
ai = list(map(int, input().split()))
m = 1
ans = 0
for a in ai:
    m = (m * a) // fractions.gcd(m, a)
m -= 1
for a in ai:
    ans += m % a

print(ans)

Solution (Python):
N = int(input())
a = [int(i) -1 for i in input().split()]

print(sum(a))

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

sum = -n 
for item in a:
    sum += item
print(sum)

Solution (Python):
def gcd(a, b) :
    if (a == 0) :
        return b
        
    return gcd(b % a, a)
 

def lcm(a,b):
    return (a*b) // gcd(a,b)
 


n=int(input())
ans=0
arr=list(map(int,input().split()))
if(n==1):
    print(arr[0]-1)
else:
    z=lcm(arr[0],arr[1])
    i=2
    while(i<n):
        z=lcm(z,arr[i])
        i+=1
ans=0
for i in range(n):
    ans+=((z-1)%arr[i])
print(ans)

Solution (Python):

N = int(input())
num = list(map(int,input().split( )))

print(sum(num)-N)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))

print(sum(a)-n)

Solution (Python):
n = int(input())
nums = list(map(int, input().split()))

nums = [num-1 for num in nums]
print(sum(nums))

Solution (Python):
N = int(input())
a_list = [int(elem) for elem in input().split(' ')]

assert len(a_list) == N

answer = sum([a - 1 for a in a_list])
print(answer)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

ans = 0
for a in A:
    ans += a - 1

print(ans)

Solution (Python):
def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)

def lcm(x, y):
    return (x * y) // gcd(x, y)

N = int(input())
A = []
s = input().split(" ")
for i in range(N):
    A.append(int(s[i]))

tmp=lcm(A[0],A[1]);
i = 2
while  i < N:
    tmp = lcm(tmp, A[i]);
    i += 1



tmp = tmp - 1;
ans=0;
for i in range(N):
    ans = ans + tmp % A[i];
print(ans)

Solution (Python):
n = int(input())
a = map(int, input().split())
print(sum(a) - n)

Solution (Python):
N=input()
A=map( int, raw_input().split() ) 

def func(m):
	ret=0
	for x in A:
		ret+=m%x
	return ret

n=1
for i in A:
	n*=i

print func(n-1)

Solution (Python):
from functools import reduce

import fractions

def gcd(x, y):
 
    if x > y:
        small = y
    else:
        small = x
    for i in range(1, small+1):
        if((x % i == 0) and (y % i == 0)):
            gcd = i
             
    return gcd
 
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

    
def main():
    n = int(input())
    a = [int(x) for x in input().split()]

    v = lcm(*a) -1
    ans = sum(v % x for x in a)
    print(ans)
    
        
if __name__ == '__main__':
    main()

Solution (Python):
N=int(input())
A=[int(x) for x in input().split()]
print(sum(A)-N)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
mm=1
for aa in a:
    mm*=aa

mm-=1
ans=0
for aa in a:
    ans+=(mm%aa)

print(ans)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

print(sum(a) - n)

Solution (Python):
N=input()
a=list(map(int,input().split()))
print(sum(a)-len(a))

Solution (Python):

n = int(input())
ary = [int(a) for a in input().split()]
print(sum([a - 1 for a in ary]))

Solution (Python):
N = int(input().strip())
A = list(map(int,input().strip().split(' ')))
print(sum(A)-N)

Solution (Python):
N=int(input())
A=input()
A=A.rstrip().split(" ")
listA=[]
for i in range(N):
    listA.append(int(A[i]))


B=1
for j in range(N):
    B=B*listA[j]


ans=0
for k in range(N):
    ans+=(B-1)%listA[k]
print(ans)

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]

sum = 0
for i in range(len(a)):
    sum += a[i]-1
print(sum)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
print(sum(a)-n)

Solution (Python):
n=int(input())
print(sum([int(j) for j in input().split()])-n)

Solution (Python):
n=int(input())
A=list(map(int, input().split()))

a=0
for i in range(n):
  a+=A[i]
print(a-n)

Solution (Python):
from functools import reduce

def g(a,b):
    while b:
        a, b = b, a % b
    return a

def l(a,b):
    return a*b//g(a,b)
    
def g_list(nums):
    return reduce(g, nums)

def l_list(nums):
    return reduce(l, nums, 1)


input()
li = input().split()
ili = []
for a in li:
    ili.append(int(a))
ll = l_list(ili)
ans = 0
for i in ili:
    ans += (ll-1) % i
print(ans)

Solution (Python):
from sys import stdin


def main():
    N = int(stdin.readline().rstrip())
    a = [int(x) for x in stdin.readline().rstrip().split()]
    print(sum([x - 1 for x in a]))


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
a = [int(t) for t in input().split()]
assert N == len(a)

print(sum(x - 1 for x in a))

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

print(sum(a)-len(a))

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
print(sum(l)-n)

Solution (Python):
from functools import reduce


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def lcm_base(x, y):
    return (x * y) // gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


N = int(input())
a = list(map(int, input().split()))

lcm_num = lcm_list(a) - 1
ans = 0
for i in range(N):
    ans += lcm_num % a[i]
print(ans)

Solution (Python):
N = int(input())
listA = [int(i) for i in input().split()]
ans = sum(listA) - N
print(ans)

Solution (Python):
from functools import reduce


def f(m, xs):
    return sum([m%x for x in xs])

def gcd(a,b):
    """Compute the greatest common divisor of a and b"""
    while b > 0:
        a, b = b, a % b
    return a
    
def lcm(a, b):
    """Compute the lowest common multiple of a and b"""
    return a * b // gcd(a, b)

N = input()
xs = input().split(' ')
xs = [int(x) for x in xs]
M = reduce(lcm, xs)
p = f(M-1, xs)
print(p)

Solution (Python):
n = int(input())
a_list = list(map(int, input().split()))

ans = 0
for a in a_list:
  ans += a - 1

print(ans)

Solution (Python):

  
N = int(input())
a = list(map(int, input().split()))

s = 0
for i in range(N):
  s += a[i] - 1

print(s)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
print(sum(a) - n)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
b=[i-1 for i in a]
print(sum(b))

Solution (Python):
N = int(input())
a = [int(i) for i in input().split()]
print(sum(a)-N)

Solution (Python):
import fractions
from functools import reduce
N = int(input())
a = [int(ai) for ai in input().split()]

def f(m):
    answer = 0
    for ai in a:
        answer += m % ai
    return answer

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(numbers):
    return reduce(lcm_base, numbers, 1)

m = lcm(a) - 1
print(f(m))

Solution (Python):
n=int(input())
s=input().split()
a=[None]*n
for i in range(n):
    a[i]=int(s[i])
print(sum(a)-n)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
print(sum(a)-N)

Solution (Python):
print(-int(input())+sum(map(int,input().split())))

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

ans = 0
for i in range(n):
    ans += a[i] - 1

print(ans)

Solution (Python):
def gcd(a,b):
    if b > a:
        a,b = b,a
    if b== 0:
        return a
    else:
        return gcd(b,a%b)

n = int(input())
a = list(map(int,input().split()))
lcm = 0
ans = 0
for i in range(1,len(a)):
    if i == 1:
        lcm = (a[0]*a[1]) // gcd(a[0],a[1])
    else:
        lcm = (lcm*a[i]) // gcd(lcm,a[i])
for i in range(0,len(a)):
    ans += (lcm-1)%a[i]
print(ans)

Solution (Python):
dataNum = int(input())
data = [int(n) for n in input().split()]
print(sum(data)-dataNum)

Solution (Python):
from fractions import gcd

n = int(input())
array = sorted([int(x) for x in input().split()])

res = 0
for i in array:
    res += i-1
print(res)

Solution (Python):
import operator
from fractions import gcd
from functools import reduce
N = int(input())
A = list(map(int, input().split()))

lcm = reduce(operator.mul, A) // reduce(gcd, A)
m = lcm - 1
print(sum(map(lambda a: m % a, A)))

Solution (Python):
n = int(input())
t = list(map(int, input().split()))
print(sum(t) - n)

Solution (Python):
def f(a, m):
    total = 0
    for a_i in a:
        total += m % a_i
    return total


if __name__ == '__main__':
    n = int(input())
    a = map(int, input().split())
    ans = sum([a_i - 1 for a_i in a])
    print(ans)

Solution (Python):
n=int(input())
a = list(map(int,input().split()))

print(sum(a)-n)

Solution (Python):

import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, A):
    ans = sum(A) - len(A)
    return ans


def main():
    N = read_int()
    A = read_int_n()
    print(slv(N, A))


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
tt = list(map(int,input().split()))
    
ss = 1

for i in tt:
    p = []
    p.append(int(ss))
    p.append(int(i))
    q = list(sorted(p))
    while q[1] % q[0] != 0:
        r = [q[1] % q[0] , q[0]]
        s = list(sorted(r))
        q[0] = int(s[0])
        q[1] = int(s[1])

        
    ss = int(ss * i) // q[0]
num = ss
kouho = 0

for onenum in tt:
    kouho += (num-1) % onenum

print(kouho)

Solution (Python):
N = int(input())
A = list(map(int,input().split()))

print(sum(A)-N)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

ans = 0
for a in A:
    ans += a - 1

print(ans)

Solution (Python):
import sys
n = int(sys.stdin.readline())
a = list(map(int, sys.stdin.readline().split()))
b = [ x - 1 for x in a ]
print(sum(b))

Solution (Python):
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def lcm(a, b):
	return a * b // gcd (a, b)

n=input()
A=list(map(int, input().split(" ")))
num=A[0]

for i in A:
    num = lcm(num, i)
    
value=0
for i in A:
    value+=(num-1)%i

print(value)

Solution (Python):
N = int(input())
a_list = list(map(int, input().split()))

ans = sum(a_list) - N

print(ans)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    a[i] -= 1
print(sum(a))

Solution (Python):
N = int(input())
A = [int(x) for x in input().split()]

print(sum(A) - N)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))

ans = sum(a) - N
print(ans)

Solution (Python):
N=int(input())
A=list(map(int,input().split()))

print(sum(A)-len(A))

Solution (Python):
N = int(input())
a_l = list(map(int, input().split(" ")))

s = 0
for a in a_l:
    s += a - 1
print(s)

Solution (Python):
import fractions


def main():
    n = int(input())
    a = list(map(int, input().split()))

    lcm_temp = 1

    for i in range(n):
        lcm_temp = lcm(lcm_temp, a[i])

    lcm_temp -= 1

    sum = 0
    for i in a:
        sum += lcm_temp % i
    print(sum)


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def lcm(a, b):
    return a*b // gcd(a, b)


if __name__ == '__main__':
    main()

Solution (Python):
input()
a = list(map(int,input().split()))
su = 0

for i in range(len(a)):
  su += a[i] - 1
  
print(su)

Solution (Python):
n=int(input())
a=[int(i) for i in input().split()]
print(sum(a)-n)

Solution (Python):
import functools
n=input()
nums=map(int,input().split())
r=functools.reduce(lambda x,y: x+y,map(lambda x: x-1,nums))
print(r)

Solution (Python):



import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string
import sys

N = int(input())
print(sum(x - 1 for x in map(int, input().split())))

Solution (Python):
N = int(input())
a=list(map(int, input().split()))

sum = 0

for i in range(N):
    sum += a[i] - 1
    
print(sum)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

print(sum(A) - N)

Solution (Python):
import sys
sys.stdin.readline()
a = list (map(int, sys.stdin.readline().split()))

print (sum(i - 1 for i in a) )

Solution (Python):
N = int(input())
a = sum(list(map(int, input() .split())))
print(a - N)

Solution (Python):
N = int(input())
A = [int(i) for i in input().split()]
print(sum(A) - N)

Solution (Python):
N = int(input())
l = list(map(int, input().split()))
res = 0

for i in range(N):
    res += l[i] - 1
    
print(res)

Solution (Python):
from sys import stdin, stdout
input = lambda: stdin.readline().rstrip()
write = stdout.write

def main():
    N = int(input())
    A = tuple(map(int, input().split()))

    ans = sum(A) - N
    print(ans)

main()

Solution (Python):
input()
A = list(map(int, input().split()))

ans = 0
x = 1

for a in A:
    x *= a

for a in A:
    ans += (x-1)%a

print(ans)

Solution (Python):
import sys
import fractions

N = int(sys.stdin.readline())
a = list(map(int, sys.stdin.readline().split()))

max_a = max(a)

tmp = a[0]
for i in a[1:]:
    tmp = (tmp * i) // fractions.gcd(tmp, i)

tmp -= 1
f = 0
for j in a:
    f += tmp % j
print(f)

Solution (Python):
N = int(input())
a = [int(i) for i in input().split()]

result = 0
for ai in a:
    result += ai - 1

print(result)