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-----
3
3 4 6

-----Sample Output-----
10

f(11) = (11\ mod\ 3) + (11\ mod\ 4) + (11\ mod\ 6) = 10 is the maximum value of f.

Difficulty: EASY

Solutions:
lis = []
N = int(input())
a = list(map(int, input().split()))
print(sum(a) - N)


input()
print(sum([a - 1 for a in map(int, input().split())]))


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


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


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


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


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


(N, *A) = map(int, open(0).read().split())
print(sum((a - 1 for a in A)))


n = int(input())
print(sum([int(j) for j in input().split()]) - n)


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


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


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


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


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


def main():
	n = int(input())
	a_lst = list(map(int, input().split()))
	maximum = sum(a_lst) - n
	print(maximum)

def __starting_point():
	main()
__starting_point()


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


N = int(input())
lis = map(int, input().split())
print(sum(lis) - N)


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


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


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


import sys
input = sys.stdin.readline
import numpy as np

def main():
	numbers = []
	n = int(input())
	numbers = np.array(list(map(int, input().split())))
	print((numbers - 1).sum())

def __starting_point():
	main()
__starting_point()


x = int(input())
y = list(map(int, input().split()))
print(sum(y) - x)


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


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


input()
print(sum((int(i) - 1 for i in input().split())))


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


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


import fractions
N = int(input())
a = list(map(int, input().split()))
ans = sum(a) - N
print(ans)


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


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


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


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


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


_ = input()
As = list(map(int, input().split()))
print(sum(As) - len(As))


N = int(input())
print(sum([int(a) - 1 for a in input().split()]))


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


N = int(input())
AN = map(int, input().split())
print(sum(AN) - N)


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


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


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


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


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


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


(N, A) = open(0)
print(sum(map(int, A.split())) - int(N))


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

def __starting_point():
	main()
__starting_point()


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


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


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


import math
from functools import reduce
n = int(input())
a_list = map(int, input().split())
result = 0
for a in a_list:
	result += a - 1
print(result)


N = int(input())
list_a = map(int, input().split())
print(sum(list_a) - N)


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


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


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


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

def __starting_point():
	main()
__starting_point()


(N, *A) = map(int, open(0).read().split())
m = 1
ans = 0
for a in A:
	ans += a - 1
print(ans)


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


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


input()
print(sum((int(_) - 1 for _ in input().split())))


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


N = int(input())
A = list(map(int, input().split()))
t = 0
print(sum(A) - N)


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


import math
from math import gcd, pi, sqrt
INF = float('inf')
import sys
sys.setrecursionlimit(10 ** 6)
import itertools
from collections import Counter, deque

def i_input():
	return int(input())

def i_map():
	return list(map(int, input().split()))

def i_list():
	return list(i_map())

def i_row(N):
	return [i_input() for _ in range(N)]

def i_row_list(N):
	return [i_list() for _ in range(N)]

def s_input():
	return input()

def s_map():
	return input().split()

def s_list():
	return list(s_map())

def s_row(N):
	return [s_input for _ in range(N)]

def s_row_str(N):
	return [s_list() for _ in range(N)]

def s_row_list(N):
	return [list(s_input()) for _ in range(N)]

def main():
	n = i_input()
	a = i_list()
	ans = 0
	for i in a:
		ans += i - 1
	print(ans)

def __starting_point():
	main()
__starting_point()


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


input()
print(sum((int(tok) - 1 for tok in input().split())))


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


(n, *a) = map(int, open(0).read().split())
print(sum([i - 1 for i in a]))


import sys
import math
from collections import defaultdict, deque, Counter
from copy import deepcopy
from bisect import bisect, bisect_right, bisect_left
from heapq import heapify, heappop, heappush
input = sys.stdin.readline

def RD():
	return input().rstrip()

def F():
	return float(input().rstrip())

def I():
	return int(input().rstrip())

def MI():
	return map(int, input().split())

def MF():
	return map(float, input().split())

def LI():
	return list(map(int, input().split()))

def TI():
	return tuple(map(int, input().split()))

def LF():
	return list(map(float, input().split()))

def Init(H, W, num):
	return [[num for i in range(W)] for j in range(H)]

def main():
	N = I()
	L = LI()
	ans = 0
	for i in L:
		ans += i - 1
	print(ans)

def __starting_point():
	main()
__starting_point()


import sys
sys.setrecursionlimit(10 ** 8)
ini = lambda : int(sys.stdin.readline())
inl = lambda : [int(x) for x in sys.stdin.readline().split()]
ins = lambda : sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print('\x1b[33m', *a, '\x1b[0m', **dict(file=sys.stderr, **kw))

def solve():
	n = ini()
	a = inl()
	ans = 0
	for x in a:
		ans += x - 1
	return ans
print(solve())