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):
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

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

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


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

A = np.array(A, dtype=int)
ans = (A - 1).sum()

print(ans)

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

ans = 0
m = 1
for i in range(0,n):
    m *= a[i]
m -= 1
for j in range(0,n):
    ans += m % a[j]
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):
import fractions
from functools import reduce
N = int(input())
A = [int(i) for i in input().split()] 

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

l = reduce(lcm, A)

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

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

print(sum(a)-n)

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

ans = 0

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

print(ans)

Solution (Python):
import sys

n, *a = map(int, sys.stdin.read().split())

def main():
    return sum(a) - n

if __name__ == '__main__':
    ans = main()
    print(ans)

Solution (Python):

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

from functools import reduce
from fractions import gcd

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

l = reduce(lcm, A) - 1


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

Solution (Python):
n = int(input())
v = [int(x) for x in input().split()]
running = 0
for x in v:
  running += x-1
print(running)

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()))
import fractions
ans = A[0]
for i in range(1, N):
    ans = ans * A[i] // fractions.gcd(ans, A[i])

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

Solution (Python):
N = int(input())
*A, = map(int, input().split())
sum = 0

for i in range(len(A)):
    sum = sum + (A[i]-1)%A[i]

print(sum)

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

print(sum(A))

Solution (Python):
import sys
import itertools
input = sys.stdin.readline
N = int(input())
li = [int(i) for i in input().split()]
sum = 0
for i in range(N) :
    sum += li[i]- 1
print(sum)

Solution (Python):
import sys
import itertools
import numpy
input = sys.stdin.readline
N = int(input())
li = [int(i) for i in input().split()]
sum = 0
for i in range(N) :
    sum += li[i]- 1
print(sum)

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

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

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

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

Solution (Python):

import sys


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


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=list(map(int,input().split()))
from fractions import gcd
x=a[0]
lcm=a[0]
for i in range(1,N):
    x=gcd(x,a[i])
    lcm=lcm*a[i]//x
ans=0
for i in range(N):
    ans+=(lcm-1)%a[i]
print(ans)

Solution (Python):
import math
from fractions import gcd

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

cross_num = 1
for a in A:
    cross_num *= a
num = cross_num-1

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

print(ans)

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

import fractions
def LCM(a,b):
  G=fractions.gcd(a,b) 
  L=(a//G)*b           
  return L

lcm = a[0]
for b in a[1:]:
  lcm = LCM(lcm,b)
ans = 0
print(sum([(lcm-1)%ai for ai in a]))

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
import fractions
def lcm(a,b):
    lcm=fractions.gcd(a,b)
    return lcm
m=1
for i in range(n):
    m=lcm(m,a[i])
    
print(sum(a)-n)

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

print(sum(a_list) - N)

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

B = []
for i in range(len(A)):
    B.append(int(A[i] - 1))

print(sum(B))

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(x, y):
    return (x*y)//fractions.gcd(x, y)
def lcm(*l):
    return reduce(_lcm, l)

N = int(input())
a = [int(x) for x in input().split()]
l = lcm(*a)
print(sum((l-1)%a[i] for i in range(N)))

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

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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N = I()
    A = LI()
    ans = 0
    for a in A:
        ans += (a-1)
    print(ans)

main()

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

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

m = 1

for i in a:
    m = lcm(m, i)

m -= 1
ans = 0

for e in a:
    ans += m % e

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

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

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

print(ans)

Solution (Python):
import sys
import numpy as np
input = sys.stdin.readline
N = int(input())
a = np.array([int(x) for x in input().split()])
a -= 1
print(a.sum())

Solution (Python):

import sys
input = sys.stdin.readline

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

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

Solution (Python):

import sys
input = sys.stdin.readline

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

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

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

Solution (Python):
import sys
readline = sys.stdin.readline
n = int(readline())
print(sum([int(i) for i in readline().split()]) - n)

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

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

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

Solution (Python):
print(-int(input())+sum(int(i) for i in input().split()))

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

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

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

lcm = lcm_list(l)
a = lcm-1
mod_all = 0

for i in l:
    mod_all += a%i

print(mod_all)

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

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

c = ans -1


ans = 0
for val in a:
    ans += c%val
print(ans)

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

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

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

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

print(sum(l)-N)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
print(sum(a)-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())
print(sum(list(map(int,input().split())))-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):
import sys
sys.setrecursionlimit(10**6)
if sys.platform in (['ios','darwin','win32']):
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return [int(s) for s in input().split()]

N = INT()
A = MAP()

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

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


print(sum([(lcm-1) % a for a in A]))

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

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


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

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


N = int(input())
seq = list(map(int, input().split()))
lcm_num = lcm(seq)

ans = 0
for num in seq:
    ans += (lcm_num - 1) % num

print(ans)

Solution (Python):
def examC():
    N = I(); A = LI()
    ans = sum(A)-N
    print(ans)

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examC()

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

Solution (Python):
import fractions


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


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

Solution (Python):
import sys
import numpy as np

n = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().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()))

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

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

a_lcd=1
for i in range(len(a)):
  a_lcd=lcd(a_lcd,a[i])
  
div=a_lcd-1
ans=0
for i in range(len(a)):
  ans+=div%a[i]
print(ans)

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

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

Solution (Python):
import sys
n = int(input())
a_ls = [int(i) for i in sys.stdin.readline().split()]
print(sum(a_ls) - n)

Solution (Python):
num = int(input())
val_list = [int(i) for i in input().split()]

ans = 0

for val in val_list:
    ans += (val -1)

print(ans)

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 = input()
L = list(map(int, input().split()))
UL = set(L)
LC = lcm_list(UL) - 1
ANS = 0
for i in L:
  ANS += LC % i
print(ANS)

Solution (Python):

import sys, math, itertools, heapq, collections, bisect, string, copy
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
mod = 10**9+7
ans = count = 0; pro = 1

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

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

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

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

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)


l = a[0]  
for i in range(1,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()))
print(sum(A)-N)

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


def product(a, b):
    return a*b


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

max_m = reduce(product,A)-1
ans = 0
for a in A:
    ans += max_m%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):
n = int(input())
L = list(map(int, input().split()))
out = 0
for i in range(n):
  out += L[i] - 1
  
print(out)

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

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

Solution (Python):
from functools import reduce
from fractions import gcd
n = int(input())
L = [int(i) for i in input().split()]
def lcm(x,y):return x*y//gcd(x,y)
def lcmm(l):return reduce(lcm,l)
ans = 0
m = lcmm(L)-1
ans = sum([m%i for i in L])
print(ans)

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

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

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

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

p=1
for i in L:
    p=lcm(i,p)
q=0
print(sum([(p-1)%i for i in L]))

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

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

m = A[0]
for i in range(1, 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())
A = list(map(int, input().split()))

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

print(ans)

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

Solution (Python):
n = input()
a = input().split()
b = []
for i in a :
    b.append(int(i));
c = 0
for i in b :
    c += i-1
print(c)

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

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

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

print(total)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect

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()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N =  INT()
a = LIST()

print(sum(a)-N)

Solution (Python):
from functools import reduce
n = int(input())
a = list(map(int,input().split()))
ans = 0
def gcd(a,b):
  if (b == 0):
    return a
  return gcd(b,a%b)

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

def get_lcm(numbers):
  return reduce(lcm,numbers)
l = get_lcm(a) - 1
for i in range(n):
  ans += l % a[i]
print(ans)

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

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

print(sum(al)-len(al))

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(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):
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()))
total = sum(a)
ans = total - n
print(ans)

Solution (Python):
n = int(input())
A = list(map(int, input().split()))
from fractions import gcd
def lcm(a, b):
  return a * b // gcd(a, b)
temp = A[0]
for i in range(n-1):
  temp = lcm(A[i+1], temp)

max_mod = sum([(temp-1) % num for num in A])
print(max_mod)

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

print(ans)

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

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

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

print(sum(value)-len(value))

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

def LCM(x,y):
    X=max(x,y)
    Y=min(x,y)
    while X%Y!=0:
        X,Y=Y,X%Y
    return x*y//Y

cnt=A[0]
for i in range(1,N):
    cnt=LCM(cnt,A[i])


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

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

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

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

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

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-1 for a in A))

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

print(sum(a))

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





print(sum(a))

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

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

Solution (Python):
from sys import stdin

n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))

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

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

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

print(m)

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

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

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

Solution (Python):
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
    n=int(input())
    A=list(map(int,input().split()))
    print(sum(A)-n)
resolve()

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

print(sum(a)-n)

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

Solution (Python):
n = int(input())
A = sorted(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)-n
print (ans)

Solution (Python):




import sys















def main():
    n, *a = (int(x) for x in sys.stdin.read().split())
    
    f = sum(a) - n
    print(f)

if __name__ == "__main__":
    
    main()

Solution (Python):




import sys







import functools






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

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


def main():
    n, *a = (int(x) for x in sys.stdin.read().split())

    m = functools.reduce(lcm, a)
    f = sum([(m - 1) % a[i] for i in range(n)])
    print(f)

if __name__ == "__main__":
    
    main()

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

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

totalA = 0

for i in A:
  totalA += (i - 1)
  
print(totalA)

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

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

Solution (Python):
input()
print(sum([a - 1 for a in 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(lambda x: int(x), input().split(' ')))

import fractions













ans = sum(A) - len(A)

print(ans)

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

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

Solution (Python):
import math
import copy
import sys
import fractions
import numpy as np
from functools import reduce




def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputoData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList




n = getInputInt()
data = getInputListInt()

ans = data[0]


for i in range(1, n):
    ans = ans * data[i] // fractions.gcd(ans, data[i])

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

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

Solution (Python):
import numpy as np
N = int(input())
alist = np.array(list(map(int, input().split())))
print(np.sum(alist - 1))

Solution (Python):
import numpy as np
N = int(input())
alist = np.array(list(map(int, input().split())))
print(np.sum(alist - 1))

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

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

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

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

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

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

print(sum(L)-n)

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


def main():
    import math
    import collections
    import itertools
    import fractions
    import functools

    n = int(input())
    as_ = list(map(int, input().split()))
        
    
    gcm = as_[0]
    for i in range(1, n):
        gcm = gcm * as_[i] // fractions.gcd(gcm, as_[i])
        
    
    gcm_1 = gcm - 1
    print(functools.reduce(lambda x, y: x + gcm_1 % y, as_, 0))

if __name__ == '__main__':
    main()

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

Solution (Python):
a=int(input(''))
b=input('')


blist = [int(i) for i in b.split(' ')]


dblist = [i-1 for i in blist]

sum = 0
for i in dblist:
    sum+=i

print(sum)

Solution (Python):
n=int(input())
l=[int(i) for i in input().split()]
lcm=l[0]
def gcd(a,b): 
    if b==0: return a 
    return gcd(b,a%b)
for i in range(1,n):
    lcm=(lcm*l[i])//gcd(lcm,l[i])
m=lcm-1 
print(sum(m%i for i in l))

Solution (Python):
import numpy as np
from functools import reduce
from fractions import gcd

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

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

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

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

print(sum(a)-n)

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

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

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

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

Solution (Python):
import sys

stdin = sys.stdin


ni = lambda: int(ns())
na = lambda: list(map(int, ns().split()))
ns = lambda: stdin.readline()

N = ni()
a = na()

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



def resolve():
    input()
    print(sum([int(i)-1 for i in input().split()]))

if __name__ == "__main__":
    resolve()

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

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


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

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


b = sorted(list(set(a)))[::-1]
m = b[0]
for i in b[1:]:
    m = lcm(m, i)

m -= 1

print(sum([m % aa for aa in a]))

Solution (Python):
N = int(input())
t = tuple(map(int,input().split()))
ans=0
for i in t:
  ans+=i-1
print(ans)

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

max = 0
for i in A:
    max += i -1
    
print(max)

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

print(sum(a)-n)

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

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

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

print(sum(l)-n)

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

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

N,*A = map(int,read().split())
answer = sum(A) - N
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()))
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()]
ans=0
for i in range(N):
    ans+=a[i]-1

print(ans)

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 = [int(e) for e in input().split()]

n = lcm_list(a_list)-1


print(sum([n%i for i in a_list]))

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]
count = 0
for i in range(len(a)):
    count +=a[i]
print(count -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()))

from fractions import gcd
x = a[0]
for i in range(N-1):
    x = (x * a[i+1]) // gcd(x, a[i+1])











r = 0
for ai in a:
    r += (x - 1) % ai
print(r)

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

Solution (Python):
import sys
inputs = sys.stdin.readlines()

n = int(inputs[0])
A = list(map(int, inputs[1].split()))

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

Solution (Python):
import sys
from fractions import gcd
lcm = lambda x, y : x*y // gcd(x, y)
from functools import reduce
inputs = sys.stdin.readlines()

n = int(inputs[0])
A = list(map(int, inputs[1].split()))

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