Permutation *p* is an ordered set of integers *p*<sub class="lower-index">1</sub>,  *p*<sub class="lower-index">2</sub>,  ...,  *p*<sub class="lower-index">*n*</sub>, consisting of *n* distinct positive integers, each of them doesn't exceed *n*. We'll denote the *i*-th element of permutation *p* as *p*<sub class="lower-index">*i*</sub>. We'll call number *n* the size or the length of permutation *p*<sub class="lower-index">1</sub>,  *p*<sub class="lower-index">2</sub>,  ...,  *p*<sub class="lower-index">*n*</sub>.

You have a sequence of integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub>. In one move, you are allowed to decrease or increase any number by one. Count the minimum number of moves, needed to build a permutation from this sequence.
The first line contains integer *n* (1 ≤ *n* ≤ 3·10<sup class="upper-index">5</sup>) — the size of the sought permutation. The second line contains *n* integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> ( - 10<sup class="upper-index">9</sup> ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>).
from sys import stdin, stdout

# Permutation is a set of distinct positive integers that are less than n
def solve(n, lst):
    lst.sort()
    steps=0
    for i in range(1,n+1):
        steps += abs(i-lst[i-1])
    return steps

#Test Area
# print("success 1" if solve(2,[3,0]) == 2 else "failed 1")
# print("success 2" if solve(3,[-1,-1,2]) == 6 else "failed 2")
# print("success 3" if solve(3,[2,1,3]) == 0 else "failed 3")
# print("success 4" if solve(3,[-100,-100,-100]) == 306 else "failed 3")
# print("success 5" if solve(3,[2,2,2]) == 2 else "failed 5")

#Printing Area
n = int(stdin.readline().rstrip("\r\n"))
lst = [ int(x) for x in stdin.readline().rstrip("\r\n").split() ]
stdout.write(str(solve(n, lst)))
