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):
N=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(N):
    ans+=(a[i]-1)
print(ans)

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())

al=list(map(int,input().split()))


minus=[a-1 for a in al]

print(sum(minus))

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

ans = 0
for i in range(n):
    tmp = mod % a[i]
    ans += tmp
print(ans)

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

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

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

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

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

print(ans-len(a))

Solution (Python):
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n = ni()
a = nl()

ans = 0

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

print(ans)

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 i in range(N):
  ans += a[i] - 1
  
print(ans)

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

import fractions
lcm = a[0]
for ai in a:
    lcm = lcm * ai // fractions.gcd(lcm, ai)
    
ans = 0
for ai in a:
    ans += (lcm-1)%ai
print(ans)

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

Solution (Python):
from fractions import gcd
n = int(input())
l = list(map(int,input().split()))
lcm = 1
for i in range(n):
    lcm = lcm*l[i]//gcd(l[i],lcm)
x = lcm-1
print(sum([x%i for i in l]))

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

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

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()))
f=0
for i in a:
    f+=i-1

print(f)

Solution (Python):
import sys
import numpy as np
import math
from functools import reduce
sys.setrecursionlimit(10**6)

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

b=1
for i in range(n):
    b*=a[i]










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










print(ans)

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()))
print(sum(a)-n)

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

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

Solution (Python):

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

gcd = 0
for i in range(1, N):
    gcd = gcd * A[i] // fractions.gcd(gcd, A[i])
print( sum( [ (gcd - 1) % a for a in A] ) )

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

print(sum(map(lambda x: x - 1, A)))

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()))
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)
x=1
for t in a:
    x=lcm(x,t)
x-=1
ans=0
for t in a:
    ans+=x%t
print(ans)

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

Solution (Python):
import sys, fractions

N = int(input())
A = list(map(int, sys.stdin.readline().rsplit()))

lcm = 1
for a in A:
    lcm = (lcm * a) // fractions.gcd(lcm, a)

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

print(res)

Solution (Python):
N=int(input())

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

print(sum(A)-N)

Solution (Python):






import sys
input = sys.stdin.readline

import math

import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache






MOD = 10**9+7
INF = float('inf')






def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]


def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()


def DD(arg): return defaultdict(arg)



def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr


def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors


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


def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count


def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))


def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count





N = I()
a = IL()
P(sum(a)-N)

Solution (Python):
import fractions
import functools
n=int(input())
a=list(map(int,input().split()))
tmp=1
for f in a:
    tmp*=f
gcd=functools.reduce(fractions.gcd, a)
lcm=tmp//gcd
lcm-=1
ans=0
for f in a:
    ans+=lcm%f
print(ans)

Solution (Python):
import fractions
n=int(input())
A=list(map(int,input().split()))
gd=1
tmp=A[0]
for i in range(n-1):
    gd=fractions.gcd(A[i+1],A[i])
    tmp*=A[i+1]
lcm=tmp//gd
lcm-=1
ans=0
for a in A:
    ans+=lcm%a

print(ans)

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

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

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

print(ans)

Solution (Python):

import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
A = np.array(lr())
A -= 1
answer = A.sum()
print(answer)

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

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

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

ls = list(map(int, input().split()))

buff = 1
for i in ls:
    buff *= i

buff -= 1

ans = 0

for i in ls:
    ans += buff % i

print(ans)

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

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


print(sum(a)-n)

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

Solution (Python):
from fractions import gcd
N = int(input())
an = list(map(int, input().split()))


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


temp = lcm(an[0], an[1])
for i in range(2, N):
    temp = lcm(temp, an[i])
ans = 0
for a in an:
    ans += (temp-1) % a
print(ans)

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = 10**18


n = I()
A = LI()
def lcm(a, b):
    g = gcd(a, b)
    return a*b//g
l = reduce(lcm, A) - 1
ans = 0
for a in A:
    ans += l % a
print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(100000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

def main():
    N = int(input())
    A = list(map(int,input().split()))
    ans = sum(a -1 for a in A)
    print(ans)
if __name__ == '__main__':
    main()

Solution (Python):

import sys
import collections

sys.setrecursionlimit(10 ** 7)


N = int(input().rstrip())


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

print(sum(A) - N)

Solution (Python):
n = int(input())
a_list = list(map(int,input().split()))
s = 0
for a in a_list:
  s += a-1
print(s)

Solution (Python):
n= int(input())
a =list(map(int,input().split()))
ans = a[0]

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

for i in range(n-1):
    ans = ans*a[i+1] // gcd(ans,a[i+1])
sum = 0
for i in range(n):
    sum += (ans-1)%a[i]
print(sum)

Solution (Python):
from fractions import gcd
N = int(input())
A = tuple(map(int, input().split()))

l = A[0]
for i in range(1, N):
    l = l * A[i] // gcd(l, A[i])
l = l - 1

f = 0 
for a in A:
    f += l % a
print(f)

Solution (Python):
n = int(input())
A = map(int, input().split())
s = 0
for i in A:
    s += i - 1
print(s)

Solution (Python):
from fractions import gcd  


def f(x, a):
    return sum([x % aa for aa in a])


def main():
    N = int(input())
    a = list(map(int, input().split(' ')))
    gcd_a = a[0]
    for i in range(1, N):
        gcd_a = gcd(gcd_a, a[i])
    lcm_a = a[0]
    for i in range(1, N):
        lcm_a *= a[i] // gcd_a
    print(f(lcm_a - 1, a))


if __name__ == '__main__':
    main()

Solution (Python):
import fractions
n=int(input())
a=list(map(int, input().split()))
ans=a[0]
for i in range(1,n):
    ans=ans*a[i]//fractions.gcd(ans, a[i])
print(sum([(ans-1)%a[j] for j in range(n)]))

Solution (Python):
import fractions
n=int(input())
a=list(map(int, input().split()))
ans=a[0]
for i in range(1,n):
    ans = ans * a[i] // fractions.gcd(ans, a[i])
tmp=0
for j in range(n):
  tmp+=(ans-1)%a[j]
print(tmp)

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

Solution (Python):
def lcm(a):
    from fractions import gcd
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

N = int(input())
S = list(map(int ,input().split()))
lcm_1 = lcm(S)-1
max_sum = 0
for i in range(N):
    max_sum += lcm_1%S[i]

print(max_sum)

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

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

Solution (Python):
input()
numbers = tuple(map(int, input().split(' ')))
print(sum([n - 1 for n in numbers]))

Solution (Python):

import collections
import itertools as it
import math

 

n  = int(input())

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




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

print(ans)

Solution (Python):


import fractions

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

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

g = A[0]
for i in range(1,N):
    g = lcm(g,A[i])
g -= 1

ans = 0
for a in A:
    ans += g % a
print(ans)

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()))
print(sum(a) - n)

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

print(sum(a)-n)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

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

Solution (Python):

"""
Created on Wed May 13 16:46:20 2020

@author: shinba
"""

n = int(input())

ans = 0

for i in map(int,input().split()):
    ans += i

print(ans-n)

Solution (Python):
n = int(input())
a = [int(i) for i in 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())
li = list(map(int,input().split()))

print(sum(li)-n)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
a = LIST()

print(sum(a)-N)

Solution (Python):

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod=10**9+7

n=I()
nums=LI()
print(sum(nums)-n)

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

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

Solution (Python):


import sys
input= lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**9)
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))

from fractions import gcd
def resolve():
    N,=pin()
    A=lispin()
    temp=A[0]
    for i in range(1,N):
        temp=(temp*A[i])//(gcd(temp,A[i]))
    x=(temp-1)
    ans=0
    for a in A:
        ans+=x%a
    print(ans)

resolve()

Solution (Python):
import sys
sys.setrecursionlimit(1000000)



'''
n=int(input())
for i in range(n):
    a[i]=int(input())
    a[i],b[i]=map(int,input().split())
a=[int(x) for x in input().split()]
n,m=map(int,input.split())

'''

test_data1 = '''\
A??C
'''

test_data2 = '''\
ACACAC
'''

test_data3 = '''\
7
994 518 941 851 647 2 581
'''

test_data4 = '''\
?AC?AC
'''
td_num=3

def GetTestData(index):
    if index==1:
        return test_data1
    if index==2:
        return test_data2
    if index==3:
        return test_data3
    if index==4:
        return test_data4
    
if False:
    with open("../test.txt", mode='w') as f:
        f.write(GetTestData(td_num))
    with open("../test.txt") as f:
        
        n=int(f.readline())
        a=[int(x) for x in f.readline().split()]
        
else:
    
    n=int(input())
    a=[int(x) for x in input().split()]
    

print(sum(a)-n)

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

print(sum(l)-len(l))

Solution (Python):
import sys
input = sys.stdin.readline

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

Solution (Python):
import sys
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def I(): return int(sys.stdin.readline().rstrip())
N = I()
a = LI()
print(sum(a)-len(a))

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
sum = 0
for s in a:
  sum += (s-1)
print(sum)

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

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
A = LI()
print(sum(A)-N)

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

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 i in a:
    ans += i-1

print(ans)

Solution (Python):
import fractions
N = int(input())
a = list(map(int, input().split()))
res = a[0]
for i in range(1,N):
    res = res*a[i]//fractions.gcd(res,a[i])
res -= 1
ans = 0
for i in range(N):
    ans += res%a[i]
print(ans)

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

Solution (Python):
import sys

input = sys.stdin.readline


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

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


if __name__ == "__main__":
    main()

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

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

print(sum(n - 1 for n in A))

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

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

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


def gcd(x, y):
    while y:
        x, y = y, x % y
    return x


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

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

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

print(ans)

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

Solution (Python):
*a, = map(int, open(0).read().split())
print(sum(a[1:])-a[0])

Solution (Python):
def main():
    *a, = map(int, open(0).read().split())
    print(sum(a[1:])-a[0])
if __name__=="__main__":
    main()

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

Solution (Python):
def main():
    n, *a = map(int, open(0).read().split())
    ans = sum(a) - n
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):


def main():
    N, *a = map(int, open(0).read().split())

    print(sum(a) - N)


main()

Solution (Python):
import sys
import os
import math
import bisect
import collections
import itertools
import heapq

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    A = il()
    q = 0
    for a in A:
        q += a - 1

    print(q)


if __name__ == '__main__':
    main()

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

Solution (Python):
import sys
import os
import math
import bisect
import collections
import itertools
import heapq

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    A = il()
    q = 1
    for a in A:
        q *= a

    print(sum((q-1) % a for a in A))


if __name__ == '__main__':
    main()

Solution (Python):


import sys






















def main():
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    n = ii()
    L = lmi()
    print(sum(L) - n)    


if __name__ == "__main__":
    main()

Solution (Python):
import math
n = int(input())
a_inputs = list(map(int,input().split()))

print(sum(a_inputs)-len(a_inputs))

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):
n=int(input())
a=list(map(int, input().split()))
ans=0

for num in a:
    ans+=num-1

print(ans)

Solution (Python):
from functools import reduce

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

print(reduce(lambda x, y: x + (y - 1), a, 0))

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

ans = sum(nums) - N

print(ans)

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
m = 1
for i in range(N):
    m *= a[i]

m-=1
for A in a:
    ans += m % A

print(ans)

Solution (Python):
N = int(input())
arr = list(map(int, input().split()))
ans = 0
m = 1
for num in arr:
    m *= num

for num in arr:
    ans += (m - 1) % num

print(ans)

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

Solution (Python):






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

    ans = sum([a-1 for a in A])

    return ans


print(main())

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

Solution (Python):

def inputlist(): return [int(k) for k in input().split()]

N = int(input())
A = inputlist()
print(sum(A)-N)

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

Solution (Python):
from fractions import gcd
from functools import reduce



import sys
sys.setrecursionlimit(2000000)



n = input()

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


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


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


b = lcm_list(a)-1
f = 0
for i in a:
    f += b % i

print(f)

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

Solution (Python):
A = int(input())
listn = map(int,input().split())
listn = map(lambda x:x-1,listn)
print(sum(listn))

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

Solution (Python):
import numpy as np

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

print(sum(a-1))

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

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

Solution (Python):
from sys import stdin
def main():
    
    readline=stdin.readline
    N=int(readline())
    A=list(map(int,readline().split()))

    res=0
    for i in range(N):
        res+=A[i]-1
    
    print(res)
if __name__=="__main__":
    main()

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

Solution (Python):

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

ans = 0
for i in range(len(a)):
  ans += a[i]

print(ans - n)

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

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

Solution (Python):
import sys
input=sys.stdin.buffer.readline
n=int(input())
L=list(map(int,input().split()))
print(sum(L)-n)

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

if __name__ == '__main__':
    main()

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

Solution (Python):
def main():
    ans = 0
    n = int(input())
    l = list(map(int, input().split()))
    for i in l:
        ans += i - 1
    print(ans)

if __name__ == '__main__':
    main()

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()))

f = 1
p = 0

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

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()))

asum=0
for ai in a:
    asum+=(ai-1)
print(asum)

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()))
print(sum(a)-N)

Solution (Python):
import fractions
from functools import reduce


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

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)

sum_a = (lcm_list(a)-1)

ans = 0
for i in a:
    ans = (sum_a % i) + ans

print(ans)

Solution (Python):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections

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

Solution (Python):
import math
N = int(input())
a = list(map(int, input().split()))
ans = 0
for _a in a:
  ans += (_a-1)
print(ans)

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

Solution (Python):
def main():
    N = int(input())
    A = [int(a) for a in input().split()]
    s = 0
    for i in range(N):
        s += A[i] - 1
    print(s)
if __name__ == "__main__":
    main()

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

Solution (Python):

import sys
try:
    from typing import List
except ImportError:
    pass


def solve(N: int, a: "List[int]"):
    print(sum(a) - N)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    a = [int(next(tokens)) for _ in range(N)]  
    solve(N, a)


if __name__ == '__main__':
    main()

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

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

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

print(sum(A)-n)

Solution (Python):
def mapint_inp():
    return map(int, input().split())

def intinp():
    return int(input())

N = intinp()
a = list(mapint_inp())

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

print(ans)

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()))
print(sum(a)-n)

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    N=int(input())
    A=list(map(int,input().split()))
    print(sum(A)-N)

if __name__ == '__main__':
    main()

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()))
print(sum(A)-N)

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

Solution (Python):


data = int(input())
array = list(map(int, input().split()))
result = sum(array) - data

print(result)

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
m = 1

for i in range(n):
    m = m*a[i]

m -= 1

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

print(ans)

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

Solution (Python):
import math
from functools import reduce
def main():
    n = int(input())
    a = list(map(int,input().split()))

    print(sum(a) - n)

if __name__ =='__main__':
    main()

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