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

print(sum(a)-n)

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

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

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


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


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

Solution (Python):
from fractions import gcd


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


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

cumlcm = A[0]
for a in A[1:]:
    cumlcm = lcm(cumlcm, a)
m = cumlcm - 1
f = sum(map(lambda a: m % a, A))
print(f)

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

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):
    while b:
        a, b = b, a % b
    return a


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



buff = 1

for i in range(N):
    buff = lcm(buff, a[i])

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

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

max_a = max(a_list)

max_amari = max_a - 1
m = max_a * 2 - 1

amari_list = []
shou_list = []

for a in a_list:
    amari_list.append(a - 1)

ans = sum(amari_list)
print(ans)

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

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

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

print(sum-N)

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

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

print(answer)

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

print(sum(a) - n)

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

print(sum(li) - len(li))

Solution (Python):
from functools import reduce
import math

def main():
    
    
    
    

    
    
    
    
    
    

    
    

    
    
    
    
    
    
    
    
    
    INF = float("inf")

    
    MOD = 10**9+7
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    N = int(input())
    a = list(int(_) for _ in input().split())
    cnt = 0
    for i in range(N):
        cnt += a[i] - 1
    print(cnt)
    
if __name__ == '__main__':
    main()

Solution (Python):
import functools
def euclid(a, b):
    if b == 0:
        return a
    else:
        return euclid(b, a%b)
def multiple(a, b):
    return a*b // euclid(a, b)
def lcm(nums):
        return functools.reduce(multiple, nums)

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

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

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

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

for a in A:
    ans += s % a

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

Solution (Python):


import sys

n = int(input())
tmp = input().split()
hoge = list(map(lambda a: int(a), tmp))

sum = 0
for i in range(0,n):
	sum+=hoge[i]
sum -= n
print(sum)

Solution (Python):


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

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

        
print(sum(c)-len(c))

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

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

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

Solution (Python):

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


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


def gcds(l):
    if len(l) == 1:
        return l[0]
    elif len(l) == 2:
        return gcd(l[0], l[1])
    else:
        n = len(l) // 2
        L = l[:n]
        R = l[n:]
        return gcd(gcds(L), gcds(R))


def lcms(l):
	if len(l) == 1:
		return l[0]
	elif len(l) == 2:
		return lcm(l[0], l[1])
	else:
		n = len(l) // 2
		L = l[:n]
		R = l[n:]
		return lcm(lcms(L), lcms(R))
      
n = int(input())
a = [int(i) for i in input().split()] 

def f(m, l):
  ans = 0
  for i in l:
    ans += m%i
  return ans

print(f(lcms(a)-1, 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()))

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

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

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

print(ans)

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

N = int(input())
a = list(map(int, input().split()))
lcm = a[0]

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

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

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

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

l_m = []
for i in range(n):
    l_m.append(a[i] - 1)
print(sum(l_m))

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

print(int(ans)-int(N))

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

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

import numpy as np

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

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


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(lambda x: int(x)-1, input().split()))

print(sum(a))

Solution (Python):

import sys
def input(): return sys.stdin.readline().rstrip()
import heapq
INF = float("inf")
def mi(): return map(int, input().split())
def ii(): return int(input())


N = ii()
As = list(map(lambda x : int(x) - 1, input().split()))

print(sum(As))

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

main()

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

sys.setrecursionlimit(10**7)
inf=10**20
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 I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()


def getPrimeList(n):
  l=[]
  t=int(math.sqrt(n))+1
  
  for a in range(2,t):
    while n%a==0:
      n//=a
      l.append(a)
  
  if n!=1:
    l.append(n)
  
  return l


def summarize_list(l):
  sl=sorted(l)

  a=l[0]
  c=1
  res=[]

  for x in sl[1:]:
    if x==a:
      c+=1
    else:
      res.append([a,c])
      a=x
      c=1
  res.append([a,c])

  return res

def main():
  n=I()
  l1=LI()

  l2=[]
  for x in l1:
    _l=getPrimeList(x)
    l2+=summarize_list(_l)

  l2.sort(reverse=True)

  k=1
  a=l2[0]
  for x in l2[1:]:
    

    if a[0]!=x[0]:
      k*=a[0]**a[1]
      a=x
      

  k*=a[0]**a[1]
  k-=1

  

  b=0
  for x in l1:
    b+=k%x

  return b


print(main())

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

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

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

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

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

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

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

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

print(sum(a) - N)

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

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

Solution (Python):


import fractions

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

N = int(input())
arr = list(map(int, input().split()))
LCM = arr[0]
ctr = 0

for i in range(1, N):
    LCM = lcm(LCM, arr[i])

for j in range(N):
    ctr += (LCM - 1) % arr[j]

print(ctr)

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

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

print(ans)

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

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

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

import fractions
from functools import reduce

def lcm_base(a,b):
	return (a*b)//fractions.gcd(a,b)

def lcm(x):
	return reduce(lcm_base,x)

y=lcm(x)-1

res=0

for j in range(n):
	res+=y%x[j]

print(res)

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

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

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

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

print(ans)

Solution (Python):
import fractions
from functools import reduce

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

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

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

num = lcm(*a) - 1

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

print(ans)

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

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


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


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


n = int(input())
lst_a = list(map(int, input().split()))
l = lcm_list(lst_a)


ans = sum((l-1) % a for a in lst_a)
print(ans)

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

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

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

ans = sum(A) - N

print(ans)

Solution (Python):
n = int(input())
an = list(map(int,input().split()))
print(sum(an)- 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):
def main():
    N = int(input())
    A = list(map(int, input().split()))
    print(sum([x-1 for x in A]))


if __name__ == "__main__":
    main()

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

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

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

lcm = lcm_list(a_lis)

result = 0
for i in range(N):
    result += (lcm - 1) % a_lis[i]
print(result)

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

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

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

Solution (Python):


from functools import reduce

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


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


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


x = reduce(lambda x, y: lcm(x, y), arr) - 1

ans = 0
for a in arr:
    ans += x % a
print(ans)

Solution (Python):
def lcm(x, y):
    import fractions
    return (x * y) // fractions.gcd(x, y)
n = int(input())
dat_a = list(map(int, input().split()))
res = dat_a[0]
for i in range(n):
    res = lcm(res, dat_a[i])
res -= 1
total = 0
for i in range(n):
    total += res % dat_a[i]
print(total)

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

N = n()
A = nl()

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

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)
def lcmm(l):
    return reduce(lcm,l)

ans = 0
x = lcmm(a)-1
for i in range(len(a)):
    ans += x % a[i]

print(ans)

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

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

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

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

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

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

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

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

ans = 0

for i in a:

    ans += (i - 1)

print (ans)

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

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

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

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

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

print(sum(A) - N)

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

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

Solution (Python):

n = int(input())

num_list = [ int(v) for v in input().split() ]
ans = sum(num_list) - n
print(ans)

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

print(sum(a)-n)

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

Solution (Python):
from functools import reduce

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

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

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

l = reduce(lcm, A)

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

print(ans)

Solution (Python):
line = input()
line= input()
words = line.split()
num_list = []
for word in words:
    num_list.append(int(word))
ans = 0
for num in num_list:
    ans = ans + (num-1)

print(ans)

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

res = 1
for a in a_list:
  res *= a

sum = 0
for a in a_list:
  sum += (res-1) % a

print(sum)

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

print(sum(a)-n)

Solution (Python):
N = int(input())
a = [int(s) for s 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):
from fractions import gcd
from functools import reduce

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


def f(l, m):
    return sum([m % x for x in l])


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


a = reduce(lcm, A)
print(f(A, a-1))

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

Solution (Python):

import time
import re
import math

def main():
    n=int(input())
    A=list(map(int,input().split()))
    total=0
    m=1
    for a in A:
        m*=a
    m-=1
    for a in range(n):
        mod=A[a]
        total+=m%mod
    print(total)
main()

Solution (Python):
N = int(input())
para = [i for i in map(int,input().split())]
"""
(a_1-1)+a_1*x_1 = (a_2-1)+a_2*x_2 = .... = (a_i-1)+a_i*x_i  = .... = (a_n-1)+a_n*x_nの解は存在する
"""
ans = 0 
for i in para :
    ans += i - 1
print(ans)

Solution (Python):
import fractions

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

m = 1
for i in range(N):
    m = (a[i] * m) // fractions.gcd(a[i], m)    
m -= 1    

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

print(ans)

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):
n = int(input())
a_s = [int(v) for v in input().split()]
ans = sum([v - 1 for v in a_s])
print(ans)

Solution (Python):
from sys import stdin
import fractions
N = int(stdin.readline().rstrip())
data = [int(x) for x in stdin.readline().rstrip().split()]


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

lcm_num = lcm(data[0],data[1])
for i in data[2:]:
    lcm_num = lcm(lcm_num,i)

ans = 0
for j in data:
    ans += (lcm_num-1) % j
print(int(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()))

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

print(ans)

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

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

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_mul = 1
for a_item in a:
  a_mul = a_mul*a_item

answer = 0
for a_item in a:
  answer = answer + (a_mul-1) % a_item



print(answer)

Solution (Python):



import sys

input = sys.stdin.readline

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

main()

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

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

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

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

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

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

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

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

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

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


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


def LCM(a, b):
    return a * b//GCD(a, b)


m = a[0]
for ni in range(1, n):
    m = LCM(m, a[ni])

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

print(ans)

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

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

print(sum(alist))

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

print(sum(A) - N)

Solution (Python):

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

Solution (Python):

import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import numpy as np

def main():
	N = int(input())
	A = list(map(int, input().split(" ")))
	
	ans = A[0]
	for i, val in enumerate(A):
		if i == 0:
			continue
		ans = lcm(ans, val)
		
	ans -= 1
	tmp = 0
	for i, val in enumerate(A):
		tmp = tmp + (ans % val)
	
	print(tmp)
	
def gcd(a, b):
	if a > b:
		a, b = b, a
		
	while a > 0:
		a, b = b % a, a
	return b
	
def lcm(a, b):
	g = gcd(a, b)
	return a // g * b
	
if __name__ == "__main__":
	main()

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

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

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

print(sum_a)

Solution (Python):
from functools import reduce


def gcd(x, y):
    if not x:
        return y
    return gcd(y % x, x)


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


n = int(input())
arr = list(map(int, input().split()))
lcm_arr = reduce(lcm, arr) - 1

print(sum([lcm_arr % x for x in arr]))

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

print(sum(A) - N)

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

Solution (Python):
from itertools import accumulate
from fractions import gcd
def lcm_(x,y):
    return x*y//gcd(x,y)
def lcm(numbers):
    return list(accumulate(numbers,lcm_))
n=int(input())
A=[int(i) for i in input().split()]
L=lcm(A)[-1]-1
f=0
for i in A:
    f+=L%i

print(f)

Solution (Python):

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

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

print(sum(A))

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=1;ans=0
for i in a:
	l = lcm(l, i)
l-=1
for i in a:
	ans += l%i
print(ans)

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

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

print(sum(a_s)-len(a_s))

Solution (Python):

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

Solution (Python):
def euc(x, y):
	if y == 0: return x
	return euc(y, x%y)

N = int(raw_input())
A = map(int, raw_input().split())
x = A[0]
for i in range(1, N):
	x = x * A[i] / euc(x, A[i])
sum = 0
for i in range(0, 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):
N = int(input())
As = list(map(int,input().split()))

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

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

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

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

Solution (Python):

import sys
input = sys.stdin.readline

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

Solution (Python):

import sys


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



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

if __name__ == '__main__':
    main()

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

Solution (Python):

from fractions import gcd


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


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

Solution (Python):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n = f()[0]
    a = f()

    print(sum(a) - n)

solve()

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

print(sum(a) - N)

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

print(sum(a) - n)

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

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

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

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

print(sum([xs-1 for xs in x]))

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

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

Solution (Python):
from fractions import gcd

N = int(input())
A = list(map(int, input().split()))
lcm = 1
for a in A:
  d = gcd(lcm, a)
  lcm = a * lcm // d
ans = 0
for a in A:
  ans += (lcm - 1) % a
print(ans)

Solution (Python):
from sys import stdin
import fractions

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

lcm_a = A[0] * A[1] // fractions.gcd(A[0], A[1])

if len(A) > 2:
    for k in A[2:]:
        lcm_a = lcm_a * k // fractions.gcd(lcm_a, k)

modulo_sum = 0

for k in A:
    modulo_sum += (lcm_a - 1) % k

print(modulo_sum)

Solution (Python):
from sys import stdin
import fractions

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

lcm_a = int(A[0] * A[1]) // fractions.gcd(A[0], A[1])

if len(A) > 2:
    for k in A[2:]:
        lcm_a = int(lcm_a * k) // fractions.gcd(lcm_a, k)

modulo_sum = 0

for k in A:
    modulo_sum += (lcm_a - 1) % k

print(modulo_sum)

Solution (Python):
from sys import stdin

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

lcm_a = A[0] * A[1]

if len(A) > 2:
    for k in A[2:]:
        lcm_a = lcm_a * k

modulo_sum = 0

for k in A:
    modulo_sum += (lcm_a - 1) % k

print(modulo_sum)

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

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

Solution (Python):

import sys


def solve(N: int, a: "List[int]"):
    ret = sum(a) - N
    print(ret)
    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 = input()
a = list(map(int, input().split()))

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

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

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

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

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

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

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