output_description: Print the number of times the operation will be performed.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      a_1 a_2 ... a_N
attempt: #!/usr/bin/env pypy3
  # -*- coding: UTF-8 -*-
  import sys
  import re
  import math
  import itertools
  import collections
  import bisect
  
  # sys.stdin=file('input.txt')
  # sys.stdout=file('output.txt','w')
  # 10**9+7
  mod = 1000000007
  # mod=1777777777
  pi = 3.1415926535897932
  IS = float("inf")
  xy = [(1, 0), (-1, 0), (0, 1), (0, -1)]
  bs = [(-1, -1), (-1, 1), (1, 1), (1, -1)]
  
  
  def niten(a, b):
      return (
          abs(a - b)
          if a >= 0 and b >= 0
          else a + abs(b) if a >= 0 else abs(a) + b if b >= 0 else abs(abs(a) - abs(b))
      )
  
  
  def fib(n):
      return [
          (seq.append(seq[i - 2] + seq[i - 1]), seq[i - 2])[1]
          for seq in [[0, 1]]
          for i in range(2, n)
      ]
  
  
  def gcd(a, b):
      return a if b == 0 else gcd(b, a % b)
  
  
  def lcm(a, b):
      return a * b / gcd(a, b)
  
  
  def eucl(x1, y1, x2, y2):
      return ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5
  
  
  def choco(xa, ya, xb, yb, xc, yc, xd, yd):
      return 1 if abs((yb - ya) * (yd - yc) + (xb - xa) * (xd - xc)) < 1.0e-10 else 0
  
  
  def pscl(num, l=[1]):
      for i in range(num):
          l = map(lambda x, y: x + y, [0] + l, l + [0])
      return l
  
  
  n = int(input())
  # n,k=map(int,input().split())
  l = [int(i) for i in input().split()]
  # ans=chk=0
  if n % 2 == 0:
      tmp = (1 + n) * (n // 2)
  else:
      tmp = (1 + n) * (n // 2) + n // 2 + 1
  print(sum(l) - tmp)
  
problem_description: Statement
  
  We have a sequence of length N consisting of non-negative integers. Consider
  performing the following operation on this sequence until the largest element
  in this sequence becomes N-1 or smaller. (The operation is the same as the one
  in Problem D.)
  
    * Determine the largest element in the sequence (if there is more than one, choose one). Decrease the value of this element by N, and increase each of the other elements by 1.
  
  It can be proved that the largest element in the sequence becomes N-1 or
  smaller after a finite number of operations.
  
  You are given the sequence a_i. Find the number of times we will perform the
  above operation.
samples: [{"input": "4\n    3 3 3 3", "output": "0\n    \n\n* * *"}, {"input": "3\n    1 0 3", "output": "1\n    \n\n* * *"}, {"input": "2\n    2 2", "output": "2\n    \n\n* * *"}, {"input": "7\n    27 0 0 0 0 0 0", "output": "3\n    \n\n* * *"}, {"input": "10\n    1000 193 256 777 0 1 1192 1234567891011 48 425", "output": "1234567894848"}]