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 fractions import gcd

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

n = int(input())
aa = [int(x) for x in input().split()]

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

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

print(sum(A)-N)

Solution (Python):
if __name__ == '__main__':
    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(x, y):
    while y:
        x, y = y, x % y
    return x
def lcm(i,j):
    return i*j//gcd(i,j)
k=1
for t in a:
    k=lcm(k,t)
k-=1
ans=0
for t in a:
    ans+=k%t
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 = [int(i) for i in input().split()]

res = 0
for x in a:
    res += x - 1

print(res)

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

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

Solution (Python):

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

ans = sum(A) - N

print(ans)

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

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

print(sum(li)-N)

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

for i in a:
    ans += i - 1

print(ans)

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

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

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

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

Solution (Python):


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

    print(sum([i-1 for i in number_list]))

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

if __name__ == "__main__":
    print(main())

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

ans = 0

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

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

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

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






r = sum(a - 1 for a in A)

print(r)

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

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

print(sum(array) - N)

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

Solution (Python):
import fractions as math

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

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

l = a[0]
for num in a[1:]:
    l = lcm(num, l)

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

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()))
M = 1

for a in A:
    M = a * M // gcd(a, M)

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

Solution (Python):
import sys
from collections import deque
import copy

from math import *

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [int(input_raw[0])]
    input_raw = read_func().strip().split()
    A = []
    for i in range(N):
        A.append(int(input_raw[i]))
    s = 0
    for i in range(N):
        s += A[i] - 1
    print s


if __name__ == '__main__':
    main()

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

ans = 0

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

print(ans)

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

M=max(a)

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

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

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

Solution (Python):
def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]
n=i1()
a=i2()
b=1
for i in range(n):
 b*=a[i]
b-=1
c=0
for i in range(n):
 c+=b%a[i]
print(c)

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

print(sum(A_list) - N)

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

Solution (Python):
def c_modulo_summation(N, A):
    ans = 0
    for a in A:
        ans += a-1
    return ans

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

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

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

print(sum(a)-n)

Solution (Python):
import sys
from functools import reduce
sys.stdin.readline()
As = list(map(int, sys.stdin.readline().split()))
print(sum(As)-len(As))

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):
from numpy import *
from scipy import *
from sys import *

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

print(sum(a)-n)

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

print(sum(a) - N)

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

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

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

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

print(ans)

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

print(sum(a)-n)

Solution (Python):
if __name__ == "__main__":
    n = int(input())
    xs = [int(s) for s in input().split()]
    print(sum(xs) - n)

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

print(sum(nums)-n)

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

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

Solution (Python):
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))

N = getN()
nums = getList()


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

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

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

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

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

M = 0
for i in A:
	M += i - 1

print(M)

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

Solution (Python):

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

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

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

ret = 0
for x in l:
  ret += x-1

print(ret)

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

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

print(ans)

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

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

print(Ans)

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

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

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

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

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

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

a_sum = sum(A)

print(a_sum-N)

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

ans = 0

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

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

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

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

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

Solution (Python):
import itertools as it
import collections as col

import sys
sys.setrecursionlimit(10000)

def main():
    N = int(input())
    a = [int(x) for x in input().split()]

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

if __name__ == '__main__':
    main()

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

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

Solution (Python):
def gcd(a, b):
    """Compute the greatest common divisor of a and b"""
    while b > 0:
        a, b = b, a % b
    return a


def lcm(a, b):
    """Compute the lowest common multiple of a and b"""
    return a * b / gcd(a, b)


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

X = 1
for i in A:
    X = lcm(i, X)

sum = 0
X -= 1
for i in A:
    sum += X % i

print(sum)

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

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

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

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

Solution (Python):
n = int(input())
a = 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):
  g = gcd(a, b)
  return a*b//g

l = 1
for ele in a:
  l = lcm(l, ele)

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

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)


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

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

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

    print(ans)


if __name__ == '__main__':
    main()

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

Solution (Python):


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

Solution (Python):
N = int(input())
As = [int(s) for s in input().split()]

print(sum(As) - N)

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

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

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

Solution (Python):
import fractions

n = int(input())
P = list(map(int, input().split()))
a = 1
for i in range(n):
    a = a * P[i] // fractions.gcd(a, P[i])

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

print(ans)

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

Solution (Python):
N = input()
A = map(int, raw_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()
a = map(int, raw_input().split())
print sum(x-1 for x in a)

Solution (Python):
_ = raw_input()
x = map(int, raw_input().split())
print sum(t-1 for t in x)

Solution (Python):
from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import defaultdict
from bisect import bisect

def read():
  return int(input())

def reads():
  return [int(x) for x in input().split()]

N = read()
A = reads()

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

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

Solution (Python):
n = int(input())
a = [int(_) for _ in 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)
x=1
for t in a:
    x=lcm(x,t)
x-=1
ans=0
for t in a:
    ans+=x%t
print(ans)

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