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

Solution (Python):


from sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy
from collections import defaultdict


mod = 1


def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


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


def combination(x, y):
    assert(x >= y)

    if y > x // 2:
        y = x - y

    ret = 1

    for i in range(0, y):
        j = x - i
        i = i + 1

        ret = ret * j
        ret = ret // i

    return ret


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    retlist.append(x)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance





def main():
    n = intin()
    alist = intina()

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

if __name__ == '__main__':
    main()

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

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

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

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

print (sum(lst)-N)

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):
from functools import reduce
from fractions import gcd
input()
aa=list(map(int,input().split()))
lcm=reduce((lambda a,b:a*b//gcd(a,b)),aa)
m=lcm-1
print(sum(m%a for a in aa))

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

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

def GCD(a,b):
    c = a%b
    if c == 0:
        return b
    else:
        return GCD(b,c)


def modsum(m):
    s = 0
    for a in A:
        s += m % a
    return s


tmp = 1
for i in range(N):
    tmp = tmp * A[i] // GCD(tmp,A[i])
    
ans = modsum(tmp-1)
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()))
ans=sum(arr)-n
print(ans)

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

N = int(input())
L = [int(v) for v in input().split()]

m = 1
for v in L:
    m = m * v
m = m - 1
ans = sum([m % v for v in L])
print(ans)

Solution (Python):

def main():
    num = int(input())
    data = list(map(int, input().split()))
    ans = 0
    for ele in data:
        ans += (ele - 1)

    print(ans)




if __name__ == '__main__':
    main()

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

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

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

print(num)

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

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):
from fractions import gcd
N = int(input())
A = list(map(int,input().split()))

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

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

ans = 0
for a in A: ans += l % a
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):
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()]


def f(m):
    global A
    return sum([m % x for x in A])


m = lcm_list(A) - 1


print(f(m))

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()))
M = lcm_list(A) - 1
ans = 0

for i in range(N):
    ans += M % A[i]

print(ans)

Solution (Python):
from fractions import gcd

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

N = int(input())
a = list(map(int, (input().split())))
l = (a[0] * a[1]) // gcd(a[0], a[1])

for i in a[2:]:
    l = lcm(l, i)

l -= 1

ans = sum(map(lambda x: l%x , a))
print(ans)

Solution (Python):

import sys
from math import *
from itertools import *
from collections import *
from functools import *
import operator
try:
    from math import gcd
except Exception:
    from fractions import gcd


def solve(N: int, a: "List[int]"):
    m = reduce(operator.mul, a) - 1
    return sum([m % x for x in a])


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) ]  
    result = solve(N, a)
    print(result)

if __name__ == '__main__':
    main()

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

print(sum(lista)-n)

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

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

print(sum(A) - N)

Solution (Python):

import numpy as np
import math
import re

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

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

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

print(sum(ai)-N)

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

print(x)

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

print(sum(list(map(lambda ai: ai-1, A))))

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

amari = list(map(int,input().split()))
    
for i in amari:
    ans += i-1
    
print(ans)

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

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

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

Solution (Python):
from functools import reduce


def gcd(a,b):
  x = max([a,b])
  y = min([a,b])
  while y:
    x, y = y, x % y
  return x

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

def lcm_list(nums):
  return reduce(lcm, nums)
n = int(input())

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




m = lcm_list(a) - 1


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

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

n = int(input())

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy
import collections
from operator import itemgetter

def j(q):
    if q==1: print("You can win")
    else:print("You will lose")
    exit(0)


def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")

def ip():
    return int(input())
def printrow(a):
    for i in range(len(a)):
        print(a[i])
def combinations(n,r):
    if n<r:return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def permutations(n,r):
    if n<r:return 0
    return math.factorial(n) // math.factorial(n - r)
n = ip()                                     

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







s = a[0]
for i in range(1,n):
    s = s * a[i] // fractions.gcd(a[i], s)
b = 0
s-=1
for i in range(n):
    b+=s%a[i]
print(b)

Solution (Python):

import functools
import operator

N=int(input())
A = [int(j) for j in input().split()]
result = functools.reduce(operator.mul, A)
ans = 0
for a in A:
    ans+=(result-1)%a
print(ans)

Solution (Python):

N=int(input())
A = [int(j) for j in input().split()]
print(sum(A)-len(A))

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

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

Solution (Python):
from sys import stdin

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

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

print(ans)

Solution (Python):
from functools import*
from fractions import*
n,*a=map(int,open(0).read().split())
def ggcd(b,c):
    return b*c//gcd(b,c)

d=reduce(ggcd,a)-1
ans=0
for i in a:
    ans+=d%i
print(ans)

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

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

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

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

N = int(input())
a = [int(x) for x in input().split()]
x = lcm(*a)-1
ans = 0
for i in a:
    ans+=x%i

print(ans)

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

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

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

def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)
        
def lcm(x, y):
    return (x * y) // gcd(x, y)
    
x = a[0]
for i in range(N-1):
    x = lcm(x, a[i+1])

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

print(sum)

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

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

	print(ans)


if __name__ == '__main__':
    main()

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

print(sum(a))

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

print(sum(As)-N)

Solution (Python):
from functools import reduce

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

m=reduce(lambda x, y: x * y, a)-1
f=sum(map(lambda x: m % x, a))

print(f)

Solution (Python):


import itertools
from collections import Counter
import bisect

def main():
    N = int(input())
    A = list(map(int, input().split()))
    ans = sum([a - 1 for a in A])
    print(ans)


if __name__ == '__main__':
    main()

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

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

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

print(ans)

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


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


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

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

print(sum(a) - N)

Solution (Python):
import fractions
from functools import reduce

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()))
lcm = lcm_list(A)

ans = 0
for i in A:
    ans += (lcm - 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()))
ans = 0
a_all = 1
for i in range(N):
  a_all = a_all*a[i]

for i in range(N):
  ans += (a_all -1) % 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 = [int(i) for i in 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):
N = int(input())
a_list = list(map(int, input().split()))
print(sum(a_list)-len(a_list))

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

for i in a:
    ans += i-1

print(ans)

Solution (Python):

import sys
import itertools
import collections
import functools
import math
from queue import Queue
INF = float("inf")


def solve(N: int, a: "List[int]"):
    print(sum([v-1 for v in a]))
    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,a=open(0);print(sum(map(int,a.split()))-int(n))

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

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

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

s = a_list[0]
for i in range(1,N):
    s = lcm(s, a_list[i])

def f(m):
    c = 0
    for a in a_list:
        c += m % a
    return c
print(f(s-1))

Solution (Python):
from functools import reduce
from operator import mul
from sys import stdin
n = int(stdin.readline().rstrip())
al = [int(_) for _ in stdin.readline().rstrip().split()]
m = reduce(mul, al)-1
print(sum(m%a for a in al))

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

print(t)

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

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

print(f-N)

Solution (Python):
N = int(input())
L = list(map(int,input().split()))
L.sort()
def gcd(x,y):
  while y != 0:
    k = x
    x = y
    y = k%y
  return  x
LCM = L[0]
for i in range(1,N):
  A = max(L[i],LCM)
  B = min(L[i],LCM)
  cur = gcd(A,B)
  if cur == 1:
    LCM *= L[i]
  else:
    LCM = LCM*L[i]//cur
LCM -= 1
ans = 0
for i in range(N):
  ans += LCM%L[i]
print(ans)

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

Solution (Python):
from functools import reduce


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


def _lcm(a, b):
    return (a * b) // _gcd(a, b)


def lcm(*n):
    return reduce(_lcm, n)


def f(_a):
    num = lcm(*_a)
    result = 0
    for i in _a:
        result += (num - 1) % i
    return result


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

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

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

Solution (Python):

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

m = a[0]

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

def lcm(a, b):
    "gcd関数を必要とする"
    return (a * b) // gcd(a,b)

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

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

Solution (Python):
import time
import sys
import math
import fractions
from functools import reduce
from collections import Counter
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) 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 MI(): return map(int, sys.stdin.readline().split())  
def II(): return int(sys.stdin.readline())  
def IS(): return input()  
def P(x): return print(x)
def C(x): return Counter(x)
def GCD_LIST(numbers):  
    return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers):  
    return reduce(LCM, numbers)
def LCM(m, n):
    return (m * n // fractions.gcd(m, n))


N = II()
a = LI()

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

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

Solution (Python):
import sys
input = sys.stdin.readline
N = int(input())
ans = 0
for a in map(int, input().split()):
    ans += a
print(ans - 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)-len(A))

Solution (Python):



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

Solution (Python):
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque, OrderedDict
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from math import ceil, floor
from sys import setrecursionlimit

import heapq
import itertools
import operator


inf = float('inf')



N = 0
A = []


def set_inputs():
    global N, A
    N = get_int()
    A = get_li()
    return


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


def main():
    setrecursionlimit(100000)
    set_inputs()
    if N == 1:
        print(A[0] - 1)
        return
    x = reduce(lcm, A) - 1
    print(sum(x % i for i in A))
    return


def get_int():
    return int(input())


def get_float():
    return float(input())


def get_str():
    return input().strip()


def get_li():
    return [int(i) for i in input().split()]


def get_lf():
    return [float(f) for f in input().split()]


def get_lc():
    return list(input().strip())


def get_data(n, types):
    if len(types) == 1:
        return [types[0](input()) for _ in range(n)]
    return zip(*(
        [t(x) for t, x in zip(types, input().split())]
        for _ in range(n)
    ))


if __name__ == '__main__':
    main()

Solution (Python):
from fractions import gcd
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=0
for a in A:
    ans+=a-1
print(ans)

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

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

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

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

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

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

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

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

Solution (Python):
from sys import stdin
import numpy as np

N = int(stdin.readline().rstrip().split()[0])
A = [int(x) for x in stdin.readline().rstrip().split()]

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

Solution (Python):
def gcd(a,b):
    while a%b!=0:
        a,b=b,a%b
    return b
def main(a,b):
    return (a*b)//gcd(a,b)
N=int(input())
A=list(map(int,input().split()))
res=A[0]
for i in range(1,N):
    res=main(res,A[i])
res-=1
ans=0
for a in A:
    ans+=res%a
print(ans)

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

print(sum)

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

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

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

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

m = sum(a)-n

print(m)

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

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

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

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

Solution (Python):

import sys
from functools import reduce
from fractions import gcd



def solve(lines):
    N = int(lines.pop(0))
    A = list(map(int, lines.pop(0).split(' ')))
    lcd = reduce(lambda i,j: i*j//gcd(i,j), A, 1)
    m = lcd - 1
    A = [ m % i for i in A ]
    print(sum(A))

lines = [x.strip() for x in sys.stdin.readlines()]




solve(lines)

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

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

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

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

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

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

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

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

print(sum)

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

print(sum(al)-n)

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

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

Solution (Python):
N = int(input())
ANs = list(map(int,input().split()))
 
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
 
def lcm_base(x, y):
	return (x * y) // gcd(x, y)
	
lcmNum = ANs[0]
for a in ANs[1:]:
	lcmNum = lcm_base(lcmNum,a)
	

 
f = 0
for a in ANs:
	f += (lcmNum-1)%a
print(f)

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

m_1 = 0
for a in ANs:
	m_1 += a-1
	
print(m_1)

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

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

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

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

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

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



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

'''

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

test_data2 = '''\
ACACAC
'''

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

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

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

print(sum(a)-n)

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

Solution (Python):
input();print(eval(input().replace(' ','-1+'))-1)

Solution (Python):
import numpy as np
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.sort() 
ans = sum(A) - N 
print(ans)

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

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

Solution (Python):
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-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 pf(s): return print(s, flush=True)

N = I()
A = LI()

def f(num):
    return sum([num%a for a in A])

res = []



res = 0











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

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

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

print(sum(A)-n)

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

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

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

l = 1
for a in Ai:
    l = lcm(l, a)
l -= 1

total = 0
for a in Ai:
    total += l % a
print(total)

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

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)//reduce(gcd, a) - 1
ans = 0
for i in range(len(a)):
    ans += max_m % a[i]
print(ans)

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

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

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
p = 1
for x in a:
    p *= x
ans = 0
for x in a:
    ans += (p-1) % x
print(ans)

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()))
s = sum(a)-len(a)
print(s)

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

Solution (Python):
input = open(0).read

N, *an = [int(i) - 1 for i in input().split()]
N += 1


def main():
    print(sum(an))
    return


main()

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

Solution (Python):
import numpy as np
n = int(input())
a = list(map(int, input().split()))
f = 0
ans = np.cumsum(a) - n
print(ans[-1])