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>).
n=int(input())
a=list(map(int,input().split()))
a=sorted(a)
count=0
for i,j in enumerate(a):
    if j<=0:
        count+=1-j
        a[i]=1
    elif j>n:
        count+=j-n
        a[i]=n
if list(set(a))==a:
    print(count)
else:
    change=list(set(list(range(1,n+1)))-set(a))
    repeat=[]
    freq={}
    for i in a:
        if freq.get(i,0)!=0:
            repeat.append(i)
        freq[i]=freq.get(i,0)+1
    max_count=0
    min_count=0
    max_change=max(change)
    min_change=min(change)
    max_repeat=[]
    min_repeat=[]
    for i in repeat:
        if i>max_change:
            max_count+=1
            max_repeat.append(i)
        elif i<min_change:
            min_count+=1
            min_repeat.append(i)
    max_sum=max(sum(max_repeat)-sum(change[-max_count:]),0)
    min_sum=min(sum(change[:min_count])-sum(min_repeat),n)
    count+=min_sum+max_sum
    print(count)