No tag edit access

The problem statement has recently been changed. View the changes.

×
C. Building Permutation

time limit per test

1 secondmemory limit per test

256 megabytesinput

standard inputoutput

standard outputPermutation *p* is an ordered set of integers *p*_{1}, *p*_{2}, ..., *p*_{n}, 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*_{i}. We'll call number *n* the size or the length of permutation *p*_{1}, *p*_{2}, ..., *p*_{n}.

You have a sequence of integers *a*_{1}, *a*_{2}, ..., *a*_{n}. 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.

Input

The first line contains integer *n* (1 ≤ *n* ≤ 3·10^{5}) — the size of the sought permutation. The second line contains *n* integers *a*_{1}, *a*_{2}, ..., *a*_{n} ( - 10^{9} ≤ *a*_{i} ≤ 10^{9}).

Output

Print a single number — the minimum number of moves.

Please, do not use the %lld specifier to read or write 64-bit integers in C++. It is preferred to use the cin, cout streams or the %I64d specifier.

Examples

Input

2

3 0

Output

2

Input

3

-1 -1 2

Output

6

Note

In the first sample you should decrease the first number by one and then increase the second number by one. The resulting permutation is (2, 1).

In the second sample you need 6 moves to build permutation (1, 3, 2).

Codeforces (c) Copyright 2010-2022 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: May/17/2022 15:06:00 (k3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|