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 = 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 math
from functools import reduce
def lcm_base(x, y):
    return (x * y) // math.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)
ans = 0
for i in a:
    ans += (lcm_num-1)%i

print(ans)

Solution (Python):
import math
from functools import reduce

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

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

n = int(input())
an = list(map(int, input().split()))
l = lcm(an)-1
an = [l%i for i in an]
print(sum(an))

Solution (Python):
if __name__ == '__main__':
	
	n = int(input())
	A = list(map(int,input().split()))

	print(sum(A)-n)

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


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


def main():
    np.set_printoptions(threshold=20)
    N = int(input())
    a = list(map(int, input().rstrip().split()))
    print(sum(a) - N)


if __name__ == '__main__':
    main()

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


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


def main():
    np.set_printoptions(threshold=20)
    N = int(input())
    a = list(map(int, input().rstrip().split()))
    ans = 0
    for v in a:
        ans += v - 1
    print(ans)


if __name__ == '__main__':
    main()

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

if __name__ == "__main__":
    main()

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

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

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

Solution (Python):
n=int(input())
print(sum(map(int,input().split()))-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()))
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 = 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()))

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

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())
print(sum(list(map(int, input().split())))-N)

Solution (Python):

import math
from functools import reduce

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

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

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

lcm = lcm_list(a)

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

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 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):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

n = k()
a = l()

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

ans -= 1
for i in a:
    cnt += ans % i

print(cnt)

Solution (Python):
import numpy as np
N = int(input())
a = list(map(int,input().split()))


ans = 0





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

Solution (Python):
import math
from functools import reduce

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

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

n=int(input())
a=list(map(int,input().split()))
b=0
c=lcm_list(a)-1

for A in a:
	b+=c%A

print(b)

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

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

Solution (Python):
import math



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

gcd = num_list[0]
mult = 1

for i in range(n):
    gcd = math.gcd(gcd,num_list[i])
    mult = mult*num_list[i]

mod_num = gcd*mult-1

c = 0

for i in range(n):
    c += mod_num % num_list[i]

print(c)

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

Solution (Python):
import math
def LCM(A):
    X = A[0]
    for I in range(1,len(A)):
        X = (X*A[I])//math.gcd(X,A[I])
    return X
  
N = int(input())
A = [int(I) for I in input().split()]
MAX = LCM(A)-1
FA  = [MAX%I for I in A]
print(sum(FA))

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

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

t = a[0]
for i in range(1,n): t = t*a[i]//gcd(t,a[i])

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

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

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 = [int(i) for i in input().split()]
print(sum([max(0, i-1) for i in A]))

Solution (Python):
import math
from functools import reduce


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


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


_ = int(input())
a = list(map(int, input().split()))
ans = 0

gcd = lcm_list(a)-1

for i in a:
    ans += gcd % i

print(ans)

Solution (Python):

n,*a=map(int,open(0).read().split())
print(sum(a)-n)

Solution (Python):









import sys
input = sys.stdin.readline

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

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

Solution (Python):
import sys
input = sys.stdin.readline
 
N = int(input().rstrip('\n'))
numbers = list(map(int,input().rstrip('\n').split()))

print(sum(numbers)-N)

Solution (Python):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

print(A - N)

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

import math
A_=list(set(A))

def lcm(a,b):
    gcd_= math.gcd(a,b)
    return int(a*b//gcd_)

lcm_ = A_[0]

for a_idx in range(1,len(A_)):
    lcm_ = lcm(lcm_,A_[a_idx])
    
lcm_ = lcm_-1
lcm_

ans=0
for a in A:

    ans+=lcm_%a
    
print(ans)

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


m = 1
for i in a_lst:
	m *= i
m -=1



print(sum([m % i for i in a_lst]))

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

t = a[0]
for i in range(1,n):
  t = t*a[i]//gcd(t,a[i])
  
ans = 0
for i in a:
  ans += (t-1)%i
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()))
 
ans = [a - 1 for a in A]
print(sum(ans))

Solution (Python):
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_nl = lambda: list(map(int, readline().split()))
in_na = lambda: map(int, read().split())
in_s = lambda: readline().rstrip().decode('utf-8')


def main():

    N = in_n()
    a = in_nl()

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


if __name__ == '__main__':
    main()

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

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

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

resolve()

Solution (Python):

def solve():
    print(sum(a) - N)

if __name__ == "__main__":
    N = int(input())
    a = list(map(int, input().split()))
    solve()

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

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

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

print(ans)

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

Solution (Python):
def resolve():
    import math
    N = int(input())
    A = [int(i) for i in input().split()]
    lcm = A[0]
    for i in range(1, N):
        lcm = lcm * A[i] // math.gcd(lcm, A[i])
    lcm -= 1
    sumA = 0
    for a in A:
        sumA += lcm % a
    print(sumA)


resolve()

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

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

Solution (Python):
from collections import defaultdict
def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

n = readInt()
a = readInts()

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

Solution (Python):
from collections import defaultdict
def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

n = readInt()
a = readInts()

ma = max(a)
ans = 0
seki = 1
for i in a:
  seki*=i

for i in a:
  ans += (seki-1)%i

print(ans)

Solution (Python):
n, aa = [list(map(lambda x:int(x), s.split())) for s in open(0)]

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

Solution (Python):
import math


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


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

    lcm_num = lcm(As[0], As[1])
    for i in range(2, n):
        lcm_num = lcm(As[i], lcm_num)

    ans = 0
    for i in range(n):
        ans += (lcm_num-1) % As[i]
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
import numpy as np
N = int(input())
a = list(map(int, input().split()))
ans = 0

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

print(ans)

Solution (Python):
from math import gcd

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

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

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

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

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

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

total = 1
for a in A:
    total *= a

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

print(ans)

Solution (Python):






import math
from functools import reduce





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





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

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





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

Solution (Python):
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce
from decimal import Decimal, getcontext

def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def f(m, num_list):
    return_num = 0
    for num in num_list:
        return_num += m % num
    return return_num

def lcm_base(x, y):
    return (x * y) // gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

def main():
    n = i_input()
    num_list = i_list()

    lcm_num = lcm_list(num_list)

    print(f(lcm_num-1,num_list))
 
if __name__ == '__main__':
    main()

Solution (Python):
import math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.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())
l = list(map(int,input().split()))

k = (lcm_list(l))-1

ans = [0]*n
for i in range(n):
    ans[i] = k%l[i]

print(sum(ans))

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

As = map(int, input().split())

rlt = 0
for a in As:
  rlt += a - 1
  
print(rlt)

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

print(sum(As)-len(As))

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):
N = int(input())
As = list(map(int, input().split()))

print(sum(As)-len(As))

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

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

print(ans)

Solution (Python):

import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial, gcd
from functools import reduce
from bisect import bisect_left 
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

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

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

val = lcm_list(A)-1
res = 0
for a in A:
    res += val%a

print(res)

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

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

def ii():
    return int(input())

def main():
    N = ii()
    a = list(mi())
    print(sum(a[i]-1 for i in range(N)))

if __name__ == '__main__':
    main()

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

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

ans = sum([v-1 for v in nums])

print(ans)

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


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


if __name__ == "__main__":
    main()

Solution (Python):
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy

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

    print(sum(a_list)-n)

if __name__ == "__main__":
    main()

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):
n=int(input())
l=list(map(int,input().split()))
print(sum(l)-len(l))

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = int(readline())
a = list(map(int, readline().split()))
ans = 0
for v in a:
    ans += v-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()))


S=0
for k in range(N):
        S+=a[k]-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()))
print(sum(a)-n)

Solution (Python):
import sys
import math
import itertools
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7

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

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

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

print(ans)

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

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

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

N = int(input())
a = LI()
f = sum(a) - N

print(f)

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):
from fractions import gcd
from functools import reduce
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(" ")]

x = lcm_list(a)-1
Sum = 0
for a_ in a:
    Sum += x%a_
print(Sum)

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

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

Solution (Python):
mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

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


if __name__ == '__main__':
    main()

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

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



print(sum(a_list)-N)

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

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

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()))
ans = [A[i]-1 for i in range(len(A))]

print(sum(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 a:
	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()))
print(sum(x-1 for x in a))

Solution (Python):
import fractions
from functools import reduce
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
N = int(input())
A = list(map(int,input().split()))
K = lcm_list(A)
L = K - 1
ans = 0
for i in range(N):
  ans += L % A[i]
print(ans)

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

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




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

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

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

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

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

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

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

print(sum([a[i]-1 for i in range(n)]))

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

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

Solution (Python):
import math
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()))

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(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())
a = list(input().split())
A = [int(a[i]) for i in range(N)]
print(sum([A[i] - 1 for i in range(N)]))

Solution (Python):
N = int(input())
A = [int(_) for _ 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())
A=list(map(int,input().split()))
print(sum(A)-N)

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

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

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

print(sum(a)-N)

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

Solution (Python):
N,A=open(0);print(sum(map(int,A.split()))-int(N))

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

Solution (Python):
import math
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_list(numbers):
    return reduce(lcm_base, numbers, 1)

MaxKoubai = lcm_list(a)
m = MaxKoubai - 1
result = 0

for i in range(N):
    result += m % a[i]
    
print(result)

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

Solution (Python):
import fractions
from functools import reduce
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

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

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

N = int(input())
*A, = map(int, input().split())
lcm_n = lcm_ret_int(*A) - 1
ans = 0
for i in range(N):
    ans += lcm_n % A[i]
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())
print(sum(map(int,input().split()))-n)

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

from fractions import gcd
from functools import reduce
def lcm(x,y):
  return x*y//gcd(x,y)

q=reduce(lcm,a)

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

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


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


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

t = reduce(lcm, a, 1) - 1
print(sum(t % a[i] for i in range(N)))

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

point = 0

for i in a:
  point += i-1

print(point)

Solution (Python):
def main():
    N = int(input())
    A = (int(x) - 1 for x in input().split())
    print(sum(A))


if __name__ == '__main__':
    main()

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
a = inpl()
print(sum(a) - n)

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

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

def lcm(A):
  x = A[0]
  for i in range(1, len(a)):
    x = (x * A[i]) // gcd(x, A[i])
  return x
 
n = lcm(a) - 1
ans = 0
for v in a:
  ans += n % v
print(ans)

Solution (Python):
def gcd(x, y):
  if y != 0:
    return gcd(y, x % y)
  else:
    return x

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

def calc(a, m):
  ans = 0
  for x in a:
    ans += m % x
  return ans

def resolve():
  n = int(input())
  a = list(map(int, input().split()))
  m = 1
  for i in range(n):
    m = lcm(a[i], m)
  m -= 1
  ans = calc(a, m)
  print(ans)
  return

if __name__ == "__main__":
  resolve()

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

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

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
a = list(map(lambda x: x-1, a))

print(sum(a))

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

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

m = lcm(a) - 1
ans = 0

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

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 9)
MOD = 10 ** 9 + 7

from fractions import gcd

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

tmp1 = A[0]
for a in A:
    tmp2 = gcd(tmp1, a)
    tmp1 = a * tmp1 // tmp2

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

print (ans)

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):
import fractions
n = int(input())
lis = list(map(int,input().split()))
now = 1
for num in lis:
    now = (now * num)//fractions.gcd(now,num)
now -= 1
ans = sum([now%lis[i] for i in range(n)])
print(ans)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


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


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


def resolve():
    n = int(input())
    A = list(map(int, input().split()))

    L = 1
    for i in range(n):
        L = lcm(L, A[i])

    res = 0
    for i in range(n):
        res += (L - 1) % A[i]

    print(res)


if __name__ == '__main__':
    resolve()

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

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

Solution (Python):
import sys
from collections import Counter
from collections import deque
import heapq
import math
import fractions
import bisect
import itertools
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n=int(input())
a=lmp()
print(sum(a)-len(a))

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

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

    print(ans)

if __name__=="__main__":
    main()

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

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

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

Solution (Python):

import math


def inp():
    return(int(input()))



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



def instr():
    s = input()
    return(list(s[:len(s)]))



def invr():
    return(map(int, input().split()))


n = inp()
a = inlist()
res = 0
for i in a:
    res += i-1
print(res)

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

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

for x in lista:
  ans+= x
  
print(ans- N)

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

    print(sum(a)-N)


if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
ls = list(map(int,input().split()))
y = lambda x : x-1
print(sum(list(map(y,ls))))

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
def main():
    n = int(readline())
    print(sum([int(i)-1 for i in readline().split()]))

if __name__ == '__main__':
    main()

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

if __name__ == '__main__':
    main()

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

Solution (Python):
from fractions import gcd


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


N = int(input())
A = list(map(int, input().split()))
LCM = A[0]
for i in range(1, N):
    LCM = lcm(LCM, A[i])
print(sum((LCM - 1) % a for a in A))

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

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