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

input()
print(sum(map(lambda x: int(x) - 1, input().split())))

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

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

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

Solution (Python):
N  = int(input())
list = [0]*N
list[0:N] = map(int,input().split()) 
result = sum(list)-N
print(result)

Solution (Python):
def modulo(n, a):
    return sum(a) - n

n = int(input())
a = map(int, input().split())
print(modulo(n, a))

Solution (Python):
n=int(input())
numbers=list(map(int,input().split()))
ans=0
for i in range(n):
    ans+=numbers[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(*numbers):
    return reduce(lcm_base, numbers, 1)
n=int(input())
numbers=list(map(int,input().split()))
m=lcm(*numbers)-1
ans=0
for i in range(n):
    ans+=m%numbers[i]
print(ans)

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

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

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

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

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

print(sum(a)-n)

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

Solution (Python):

input()
a = list(map(int, input().split()))
x = 1
for i in a:
    x *= i
print(sum(list(map(lambda j: (x - 1) % j, a))))

Solution (Python):
def gcd(m, n):
    if n == 0:
        return m
    return gcd(n, m % n)


def m():
    n = int(input())
    a = list(map(int, input().split()))
    tmp = a[0]
    ans = 0
    modv = tmp
    for i in range(1, n):
        tmp = gcd(modv, a[i])
        modv = (modv*a[i] // tmp)
    for i in range(n):
        ans += (modv-1) % a[i]
    return ans
print(m())

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

s=0
for i in a:
  s+=i-1
print s

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

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

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

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

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

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

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

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

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

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

Solution (Python):
n = int(input())
l = [int(_) for _ in input().split()]

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

Solution (Python):
import fractions
n = int(input())
lis = list(map(int,input().split()))
cou = 1
for i in range(n):
  cou = (cou * lis[i])//fractions.gcd(cou, lis[i])
cou -= 1
print(sum([cou % lis[i] for i in range(n)]))

Solution (Python):

"""
C - Modulo Summation
https://beta.atcoder.jp/contests/abc103/tasks/abc103_c

"""
import sys
from sys import stdin
input = stdin.readline


from fractions import gcd

def solve(arr):
    def calc_sum(m, arr):
        return sum([m%a for a in arr])

    def calc_lcm(arr):
        t = arr[0]
        for a in arr[1:]:
            t = t * a // gcd(t, a)
        return t

    lcm = calc_lcm(arr)
    return calc_sum(lcm-1, arr)


def main(args):
    N = int(input())
    arr = [int(a) for a in input().split()]
    ans = solve(arr)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

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

print(sum(array)-n)

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

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

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

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

Solution (Python):
import fractions
from functools import reduce

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

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

m = reduce(lcm, a) - 1
print(sum(map(lambda a: m % a, a)))

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

Solution (Python):
def main():
	n = int(input())
	a_list = list(map(int, input().split()))
	print(sum(a_list) - len(a_list))
	
if __name__ == '__main__':
	main()

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

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

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

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

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

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

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

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

Solution (Python):
n = int(raw_input())
l = map(int, raw_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())
list_a = list(map(int,input().split()))
a = 0
for i in range(N):
    a += list_a[i]-1
print(a)

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

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

if __name__ == "__main__":
    main()

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

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

Solution (Python):


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

Solution (Python):


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

print(sum(a)-N)

Solution (Python):
def gcd(x, y):
	m = x
	n = y
	while n != 0L:
		tmp = n
		n = m % n
		m = tmp
	return m

n = int(raw_input())
a = map(long, raw_input().split())
lcm = 1L
for i in range(0, n):
	lcm = lcm * a[i] / gcd(lcm, a[i])
sum = 0L
for i in range(0, n):
	sum = sum + (lcm-1L) % a[i]
print sum

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

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

Solution (Python):
def solution(a):
    
    return sum(a) - len(a)

def main():
    n = int(raw_input().strip())
    a = [int(i) for i in raw_input().strip().split()]
    print solution(a)

if __name__ == '__main__':
    main()

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

Solution (Python):

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


print(sum(a) - N)

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

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

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

alcm = a[0]
for i in a[1:]:
  alcm = lcm(alcm, i)

res = 0

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

print(int(res))

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

alcm = a[0]
for i in a[1:]:
  alcm = lcm(alcm, i)

res = 0

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

print(int(res))

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

_A = list(map(lambda x: x - 1, A))

print(sum(_A))

Solution (Python):

n = input()
ret = 0
for a in input().split(" "):
    a = int(a)
    ret += a-1

print(ret)

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

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

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

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

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

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

gcd = a[0]
for i in range(1, len(a)):
    if(gcd < a[i]):
        ret = GCD(a[i], gcd)
    else:
        ret = GCD(gcd, a[i])
    gcd = gcd * a[i] // ret
ans = 0
for i in range(len(a)):
    ans += (gcd - 1) % a[i]
print(ans)

Solution (Python):


n=int(raw_input())
a=map(int,raw_input().split())
res=0
for i in xrange(n):
 res+=a[i]-1
print res

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

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

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

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

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

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

m = (prod - 1)

result = 0
for i in a:
    result += m % i
print(result)

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)


def main():
    n = I()
    a = LI()
    m = 0
    for c in a:
        m += c - 1
    return m


print(main())

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

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

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

print(sum(a) - N)

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

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

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

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

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

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

print(sum(A) - N)

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

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

print(sum(a)-N)

Solution (Python):

"""
Created on Mon Aug  6 17:15:00 2018

@author: Yuki
"""

N = int(input())

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






















print(sum(A) - N)

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

Solution (Python):
import sys

sys.setrecursionlimit(3100)

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

def lcm(l):
    def aux(l, i):
        if i == len(l) - 1:
            return l[-1]
        rest = aux(l, i+1)
        return l[i] * rest // gcd(l[i], rest)
    return aux(l, 0)

def modsum(a):
    k = lcm(a) - 1
    return sum(map(lambda x: k % x, a))

if __name__ == '__main__':
    _ = input()
    a = list(map(int, input().split()))
    print(modsum(a))

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

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

print(sum - n)

Solution (Python):
def main(N, a):
    m = getlcm(N, a) - 1
    f = 0
    for i in range(N):
        f += m % a[i]
    print(f)

def getlcm(N, a):
    l = 1
    for i in range(N):
        l = l * a[i] // gcd_(l, a[i])
    return l

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

if __name__ == '__main__':
    N = int(input())
    a = [int(i) for i in input().split()]

    main(N, a)

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

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

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

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

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

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

l1 = sys.stdin.readline()
N = int(l1.strip())
l2 = sys.stdin.readline()
l2 = l2.strip()
M = [int(x) for x in l2.split()]

X = lcm_list(M) - 1
Y = 0

for x in M:
  Y += X % x

print(Y)

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

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

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

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

print(str(sum(list_int) - int(number_int)))

Solution (Python):

if __name__ == "__main__":
    N = int(input())
    alist = [int(x)-1 for x in input().split(" ")]
    print(sum(alist))

Solution (Python):


def gcd(n1, n2):
    if n1 < n2:
        n1, n2 = n2, n1

    while n1 % n2 != 0:
        rest = n1 % n2
        n1, n2 = n2, rest

    return n2

def lcm(n1, n2):
    return n1 * n2 // gcd(n1, n2)

def getM(alist):
    nLcm = lcm(alist[0], alist[1])
    for i in range(2, len(alist)):
        nLcm = lcm(nLcm, alist[i])
    
    return nLcm-1

def f(m, alist):
    t_sum = 0
    for ai in alist:
        t_sum +=  m % ai

    return t_sum
    
if __name__ == "__main__":
    N = int(input())
    alist = [int(x) for x in input().split(" ")]
    print(f(getM(alist), alist))

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

Solution (Python):
N = int(input())
li = input().rstrip().split()
le=[0]*N
for i in range(0,N):
    le[i]=int(li[i])

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

print(sum)

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

Solution (Python):


from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


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())
input_lines = input().split()

for j in range(len(input_lines)):
    input_lines[j]=int(input_lines[j])


p=0
for i in input_lines:
    p=p+i-1
    
print(p)

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

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

main()

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

print(sum(a) - N)

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

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

Solution (Python):


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

for i in range(len(a)):
	a[i]=a[i]-1
	s+=a[i]

print(s)

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

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

Solution (Python):


str = input()
n = int(str)
str2 = input()
list = [int(y) for y in str2.split(" ")]
 
print(sum(list)-n)

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

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

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

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

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

Solution (Python):
import functools
import fractions

N = int(input())
numbers = list(map(int, input().split()))
answer = sum([n - 1 for n in numbers])

print(answer)

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

Solution (Python):
def main():
    """
    2 <=  N <= 10^3
    2 <= ai <= 10^5

    非負整数 m に対して
    f(m) = (m mod a1) + (m mod a2) + (m mod aN)
    f_max

    mの制約は問題文中には直接記述されていない
    """
    N = int(input())
    *A, = map(int, input().split())

    ans = editorial(N, A)
    print(ans)


def f(N, A):
    """
    直感: 最小公倍数,最大公約数
        最小公倍数のm ならすべてのaで割り切れる
        つまり最小公倍数-1 ならすべてのaについて m mod ai = ai - 1

    m=a_MAX-1, (m mod a_MAX) が最大
    ただし他のa=a_MAX-1 の場合、f(m)は小さくなってしまう
    aiに対して1 <= m <= a_Max-1 をすべて試す: 10^5 * 3 * 10^3 => TLE
    """
    try:
        
        from math import gcd
    except:
        from fractions import gcd

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

    m1 = lcm(A[0], A[1])
    for a in A[2:]:
        m1 = lcm(m1, a)

    m = m1 - 1
    ans = sum(m % a for a in A)

    return ans


def editorial(N, A):
    """
    lcm を求めなくても、ai - 1 であることはわかるので
    lcm を計算しなくてよい
    """
    return sum(a - 1 for a in A)


def WA(N, A):
    ans = 0
    m_max = max(A) * 2 - 1
    for m in range(1, m_max):
        mods = [m % a for a in A]
        tmp = sum(mods)
        print(*(mods + [tmp]), sep="\t")
        ans = max(ans, tmp)

    return ans


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    count = int(input())
    num_str = input().split()
    num_list = []
    num_list = [int(s, 10) for s in num_str]
    sum = 0
    for i in range(count):
        sum += num_list[i]
    print(sum - count)

if __name__ == "__main__":
    main()

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

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

Solution (Python):
import sys
import math
import numpy as np
import itertools



n = int(input())

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

print(answer)

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

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

def f(m, a):
    return sum([m % i for i in a])

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

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

print(f(lcm -1, arr))

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

Solution (Python):
def getinputdata():

    array_result = []    
    array_result.append(input().split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

n=int(arr_data[0][0])

arr=[int(arr_data[1][x]) for x in range(n)]


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

Solution (Python):
N = int(input())
line = input().split()
r = 0
for i in range(N):
    r += int(line[i]) - 1
print(r)

Solution (Python):
import fractions
from functools import reduce

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

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 = input()
N = int(N)
a = list(map(int,input().split()))
m = lcm(*a)
x = 0
for j in range(N):
  x += (m-1) % a[j]
print(x)

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(" ")))
a = list(map(lambda x: x-1,a))
print(sum(a))

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

Solution (Python):
import functools
import fractions

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

def slcm(numbers):
	return functools.reduce(blcm, numbers)
	
input()
numbers=list(map(int, input().split()))
num=slcm(numbers)-1
nums=[num%i for i in numbers]
print(sum(nums))

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

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

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

arr = [int(a) - 1 for a in input().split()]

print(sum(arr))

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

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

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

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

Total = 1
for i in range(len(a)):
    Total *= a[i]

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

print(ans)

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

m = input().split()
sum = 1
for i in range(N):
	sum *= int(m[i])
ans = 0
for i in range(N):
	ans += (sum - 1) % int(m[i])
print(ans)

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

Solution (Python):
def main():
    input()
    lcm = 1
    num_list = [int(i) for i in input().split()]
    for i in range(len(num_list)):
        lcm = num_list[i] * lcm
    lcm -= 1

    counter = 0
    for i in num_list:
        counter += (lcm % i)
    
    print(counter)

main()

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

ans = sum(a) - n

print(ans)

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

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

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

lcm=a[0]
for ai in a[1:]:
    gcd=lcm
    lcm*=ai
    if ai<lcm:
        gcd,ai=ai,gcd
    while ai%gcd!=0:
        gcd,ai=ai%gcd,gcd
    lcm//=gcd

s=0    
for ai in a:
    s+=(lcm-1)%ai
print(s)

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

print(sum(a) - N)

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

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

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

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

seq.sort()

print(sum(seq)-n)

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

Solution (Python):
def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)
 
n=int(input())
A=list(map(int,input().split()))
ans=1
for x in A:
    ans=ans*x//gcd(ans,x)
ans-=1
t=0
for x in A:
    t+=ans%x
print(t)

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):
import sys
import fractions

dp = None
A = []

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

def f(m):
    ans = 0
    for a in A:
        ans += m % a
    return ans

def main():
    global A

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

    lcmtemp = 1

    for a in A:
        lcmtemp = lcm(lcmtemp, a)

    print(f(lcmtemp-1))

main()

Solution (Python):
import numpy as np
import collections as col
import math
N = int(input())
A = list(map(int, input().split()))

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

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

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

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

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

print (sum(data) - n)

Solution (Python):


















''' 二次元配列を一列ずつ
for i in ans:
	print(*i)
'''
''' heapq
queue = []
heapq.heapify(queue) 
heapq.heappush(queue,num) 
pop = heapq.heappop(queue) 
pop = heapq.heappushpop(queue,num) 

'''

from collections import defaultdict
import sys,heapq,bisect,math,itertools,string
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7


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


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

N = int(input())
aa = list_int = list(map(int,input().split()))

mod = 1

for i in range(N):
	mod = lcm(aa[i],mod)

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

print(ans)

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

Solution (Python):
import math


class Sieve:
    """Sieve of Eratosthenes.

    List primes up to n.
    """

    def __init__(self, n):
        self.__prime = []
        self.__is_prime = [i >= 2 for i in range(n + 1)]

        for i in range(2, int(math.sqrt(n)) + 1):
            if self.__is_prime[i]:
                for j in range(i * i, n + 1, i):
                    self.__is_prime[j] = False

        for i in range(2, n + 1):
            if self.__is_prime[i]:
                self.__prime.append(i)

    def prime(self):
        return self.__prime

    def is_prime(self, n):
        return self.__is_prime[n]


def bf(N, a):
    p = Sieve(max(a) + 1).prime()  

    prime_to_power = {}
    for prime in p:
        prime_to_power[prime] = 0

    for i in range(N):
        ai = a[i]
        for prime in p:
            power = 0
            while ai % prime == 0:
                ai //= prime
                power += 1
            prime_to_power[prime] = max(prime_to_power[prime], power)
    lcm = 1
    for prime in prime_to_power:
        lcm *= prime ** prime_to_power[prime]
    m = lcm - 1
    ans = 0
    for ai in a:
        ans += m % ai
    return ans


def al(N, a):
    return sum(a) - len(a)


if __name__ == '__main__':
    N = int(input())  
    a = list(map(int, input().split()))  
    
    print(al(N, a))

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

print(str(sum(a) - n))

Solution (Python):
n = int(input())
a = input().split()
sum = 0

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

print(sum)

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


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

print (ans)