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

print(sum(a)-N)

Solution (Python):

import sys
input=sys.stdin.readline
import numpy as np

def main():
    numbers=[]
    n = int(input())
    numbers=np.array(list(map(int,input().split())))

    print((numbers-1).sum())

    

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_l = list(map(int, input().split()))
m = 1
for a in a_l:
    m *= a
ans = 0
for a in a_l:
    ans += (m-1)%a 
print(ans)

Solution (Python):
import sys
import math
from collections import defaultdict, deque, Counter
from copy import deepcopy
from bisect import bisect, bisect_right, bisect_left
from heapq import heapify, heappop, heappush
    
input = sys.stdin.readline
def RD(): return input().rstrip()
def F(): return float(input().rstrip())
def I(): return int(input().rstrip())
def MI(): return map(int, input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def LF(): return list(map(float,input().split()))
def Init(H, W, num): return [[num for i in range(W)] for j in range(H)]
    
    
def main():
    N = I()
    L = LI()
    ans = 0
    for i in L:
        ans += i-1
    print(ans)
if __name__ == "__main__":
    main()

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

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

Solution (Python):



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

Solution (Python):


def get_input() -> tuple:
    """
    標準入力を取得する.

    Returns:\n
        tuple: 標準入力
    """
    N = int(input())
    a = list(map(int, input().split()))

    return N, a


def main(N: int, a: list) -> None:
    """
    メイン処理.

    Args:\n
        N (int): 正整数の数(2 <= N <= 3000)
        a (list): 正整数(2 <= a_i <= 10^5)
    """
    
    ans = sum(a) - N

    
    print(ans)


if __name__ == "__main__":
    
    N, a = get_input()

    
    main(N, a)

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

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

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

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

print(s-N)

Solution (Python):

import fractions


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


ans = sum(a) - N


print(ans)

Solution (Python):
import sys
import math
import heapq


def input():
    return sys.stdin.readline().rstrip()


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


    print(sum(A)-N)

if __name__ == "__main__":
    main()

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

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

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

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

m = a[0]
for i in range(n):
  m = lcm(m,a[i])
m -= 1

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

print(ans)

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

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(*numbers):
  return reduce(lcm_base, numbers, 1)

ans = 0
lcm = lcm(*A)

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

Solution (Python):
N,*A = map(int,open(0).read().split())

m =1
ans = 0
for a in A:
  m *=a
m-=1

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

Solution (Python):
N,*A = map(int,open(0).read().split())

m =1
ans = 0









for a in A:
  ans += a-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)-len(A))

Solution (Python):
import fractions

N = int(input())
a = list(map(int, input().split()))
l = a[0]
for i in range(1,N):
  l = l * a[i] // fractions.gcd(l, a[i])
m = l-1
fm = 0
for i in range(N):
  fm += m % a[i]
print(fm)

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



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

print(ans)

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

print(sum(a)-n)

Solution (Python):

"""
Created on Fri Sep 18 10:04:50 2020

@author: liang
"""
N = int(input())
A = [int(x)-1 for x in input().split()]
ans = sum(A)
print(ans)

Solution (Python):
import math
from math import gcd,pi,sqrt
INF = float("inf")

import sys
sys.setrecursionlimit(10**6)
import itertools
from collections import Counter,deque
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_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]

def main():
    n = i_input()
    a = i_list()
    ans = 0
    for i in a:
        ans += i-1
    print(ans)


if __name__=="__main__":
    main()

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

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

N=int(input())
a=list(map(int,input().split()))
lcm=1
for i in range(N):
    lcm=lcm*a[i]//math.gcd(a[i],lcm)

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

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

print(sum(a)-n)

Solution (Python):
def solve():
    _ = int(input())
    A = [int(i) for i in input().split()]
    ans = sum([a - 1 for a in A])
    print(ans)


if __name__ == "__main__":
    solve()

Solution (Python):




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

    n = input().rstrip()
    a_list = [int(x) for x in input().rstrip().split(" ")]

    print(sum(a_list) - len(a_list))

if __name__ == "__main__":
    resolve()

Solution (Python):

 
from functools import reduce
import math 
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)



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

saisyo_koubaisu =lcm_list(a)
ans =0
for aa in a:
    ans += (saisyo_koubaisu-1) %aa
print(ans)

Solution (Python):
import math

def main():
    N = int(input())
    A = list(map(int, input().split()))
    lcm = 1
    for a in A:
        lcm = lcm * a // math.gcd(lcm, a)
    m = lcm - 1

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


if __name__ == '__main__':
    main()

Solution (Python):
import math

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

prod = a[0]
lcm = a[0]
for i in range(1,N):
    x = math.gcd(lcm, a[i])
    lcm = (lcm*a[i])//x

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

Solution (Python):
import math
from functools import reduce

n = int(input())
a_list = map(int, input().split())
result = 0
for a in a_list:
    result += a - 1 

print(result)

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

calc = 0

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

print(calc)

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

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):
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 bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()
    a = LI()

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

if __name__ == '__main__':
    resolve()

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 x in a:
    ans += x - 1
print(ans)

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

Solution (Python):
from math import gcd


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


N = int(input())
A = list(map(int, input().split()))
X = A[0]

for a in A[1:]:
    X = lcm(X, a)
X -= 1
ans = 0
for a in A:
    ans += X % a
print(ans)

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


ans = 0
val1, val2 = a[0], a[1]
while 1:
  if val1 % val2 == 0:
    ans = a[0]*a[1]//val2
    break
  else:
    tmp = val2
    val2 = val1 % val2
    val1 = tmp

for i in range(2, N):
  val1, val2 = ans, a[i]
  while 1:
    if val1 % val2 == 0:
      ans *= a[i]//val2
      break
    else:
      tmp = val2
      val2 = val1 % val2
      val1 = tmp

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

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

A = list(map(lambda x: int(math.copysign(x-1, x)), A))

print(sum(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())
a = list(map(int,input().split()))
answer = 0 
m = a[0]

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

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

print(answer)

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

print(S-N)

Solution (Python):
import math

N=int(input())
List = list(map(int, input().split()))
mid = List[0]
for i in range(1,N):
  mid = mid * List[i] // math.gcd(mid, List[i])
res = 0
for i in range(N):
  res += (mid-1) % List[i]
print(res)

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

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



ans=0
for i in li:
    ans+=i

print(ans-n)

Solution (Python):
N = int(input())
S = list(map(int,input().split()))
print(sum(S)-len(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 math
def lcm(a,b):
  return a*b//math.gcd(a,b)

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

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

from math import gcd
from functools import reduce

def lcm(x,y):
    return x*y//gcd(x,y)
    
a = reduce(lcm,L)

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

print(ans)

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

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

Solution (Python):
i = input;i();print(sum([int(x)-1 for x in i().split()]))

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

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

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

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

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])
ans=ans-1
b=0

for i in a:
    b=b+ans%i
print(b)

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

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

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

print(sum(l))

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

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

ans = 0
for i in a:
    ans += i-1
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):
  return reduce(lcm_base, list, 1)

n = int(input())
a = list(map(int, input().split()))
l = lcm(a) - 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):
import math
N = int(input())
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, N):
    ans = ans * a[i] // math.gcd(ans, a[i])

tmp = ans - 1
mod = 0
f = 0
for i in range(N):
    mod = tmp % a[i]
    f += mod
print(f)

Solution (Python):
import math
from functools import reduce


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

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


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

MOD = lcm_list(A)-1

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

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

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
ans = 0
for v in a:
  ans += v-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 = map(int,input().split())
print(sum(A)-N)

Solution (Python):
def f(m):
    ans = 0
    for i in range(len(a)):
        ans += m%a[i]
    return ans

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

print(sum(a)-n)

Solution (Python):
N = input().rstrip()
res = 0
for a in map(int, input().split()):
    res += a-1
print(res)

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

print(sum(a)-n)

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

print(sum(ans)-n)

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

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

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

ans=[]
for ai in a:
  ans.append(ai-1)

print(sum(ans))

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

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

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

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

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()))
ans=0
g=lcm_list(a)-1
for i in a:
    ans+=g%i
print(ans)

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

if __name__=='__main__':
    main()

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

def main():
  N = int(input())
  A = list(map(int,input().split()))
  num = lcm(A, N) - 1
  answer = 0
  for i in A:
    answer += num % i
  print(answer)

if __name__=='__main__':
    main()

Solution (Python):

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

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

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

def gcd(x, y):
    x, y = min(x, y), max(x, y)
    while True:
        mod = y % x
        if mod == 0:
            break
        y = x
        x = mod

    return x

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

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

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

def gcd(x : int, y : int):
    x, y = min(x, y), max(x, y)
    while True:
        mod = y % x
        if mod == 0:
            break
        y = x
        x = mod

    return x

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

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

Solution (Python):
import math
n = int(input())
a = list(map(int, input().split()))
lcm = a[0]
for i in range(1, n):
    lcm = lcm * a[i] // math.gcd(lcm, a[i])

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

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

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

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

Solution (Python):
import sys;      from decimal import Decimal
import math;     from itertools import combinations, product
import bisect;   from collections import Counter, deque, defaultdict


MOD = 10 ** 6 + 7
INF = 10 ** 9
PI = 3.14159265358979323846

def read_str():      return sys.stdin.readline().strip()
def read_int():      return int(sys.stdin.readline().strip())
def read_ints():     return map(int, sys.stdin.readline().strip().split())
def read_str_list(): return list(sys.stdin.readline().strip().split())
def read_int_list(): return list(map(int, sys.stdin.readline().strip().split()))
def lcm(a: int, b: int) -> int: return (a * b) // math.gcd(a, b)

def Main():
    n = read_int()
    a = read_int_list()
    ans = 0
    for i in range(n):
        ans += a[i] - 1
    print(ans)

if __name__ ==  '__main__':
    Main()

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
ans = 0
for aa in a:
  ans += (aa-1)
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)

if __name__ == '__main__':

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

    ans = lcm(*A) - 1

    tmp = 0
    for i in A:
        tmp += ans % i
    print(tmp)

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

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

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
a.sort()
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)
def lcm(a, b):
    return (a*b)//gcd(a, b)
llcm = 1
for i in a:
    llcm = lcm(llcm, i)
ans = 0
for i in a:
    ans += (llcm-1)%i
print(ans)

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

Solution (Python):
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n = ni()
    print(sum(list(map(lambda x: x - 1, nl()))))


if __name__ == '__main__':
    main()

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):
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([i-1 for i in a]))

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 main():
    n = int(input().strip())
    A = [int(i) for i in input().split()]
    print(sum(A) - n)

    return


if __name__ == "__main__":
    main()

Solution (Python):

import sys
input=sys.stdin.readline

def main():
    number = int(input())
    numbers=[]
    numbers=list(map(int,input().split()))
    answer=0
    for i in numbers:
        answer+=i-1
    print(answer)

if __name__=="__main__":
    main()

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, *A = map(int, read().split())

    print(sum(A) - N)

    return


if __name__ == '__main__':
    main()

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

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

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

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

    print(sum(inlis)- n)


if __name__ == "__main__":
    main()

Solution (Python):
print(-int(input())+eval(input().replace(" ","+")))

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

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

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

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


import math

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



s = 0

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

print(s)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
f_max = 0
for a in A:
    f_max += a-1
print(f_max)

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

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

print(sum(al)-n)

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

Solution (Python):
def resolve():
    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)
    m = lcm-1
    ans = 0
    for i in range(n):
      ans += m % A[i]
    print(ans)
resolve()

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

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

import math
from functools import reduce

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

def lcm_list(numbers):
    return reduce(lcm, numbers)

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

print (ans)

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

print(sum(A) - n)

Solution (Python):
import math
from functools import reduce

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

m=reduce(lambda x,y: (x*y)//math.gcd(x,y), A, 1)
print(sum((m-1)%i for i in 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()))
ans = sum(a) - N
print(ans)

Solution (Python):

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

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

Solution (Python):
import math

n = int(input())
a = list(map(int, input().split()))
common_num = 1
for num in a:
    common_num = (common_num * num) // math.gcd(common_num, num)
total = 0
for num in a:
    total += (common_num - 1) % num
print(total)

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

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

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

Solution (Python):
import math
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 math
n = int(input())
a = list(map(int, input().split()))
f = 0
lcd = 1
for i in a:
  lcd = lcd * i // math.gcd(lcd, i)
for i in range(n):
  f +=  (lcd - 1) % a[i]
print(f)

Solution (Python):
n=int(input())
ar=[int(i)-1 for i in input().strip().split(" ")]
print(sum(ar))

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

print(ans)

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

print(sum(a) - N)

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

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

Solution (Python):
from functools import reduce
import math

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

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

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

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

m=lcm_list(a)-1

ans = 0

for num in a:
    ans+=m%num

print(ans)

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

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

Solution (Python):


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

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

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

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



















































def calculation(lines):
    N = int(lines[0])
    values = list(map(int, lines[1].split()))
    
    return [sum(values) - N]



def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines



def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['3', '3 4 6']
        lines_export = [10]
    if pattern == 2:
        lines_input = ['5', '7 46 11 20 11']
        lines_export = [90]
    if pattern == 3:
        lines_input = ['7', '994 518 941 851 647 2 581']
        lines_export = [4527]
    return lines_input, lines_export



def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode



def main():
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(2)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    
    
    
    
    
    
    
    



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

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


result = 0
for a in an:
    result += (a -1)

print(result)

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

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