import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int []A = new int[N]; for(int i = 0; i < N; i++) { A[i] = scan.nextInt(); } scan.close(); Arrays.sort(A); int sum = 0; for(int i = N - 1; i >= 0; i--) { sum += Math.abs(i + 1 - A[i]); } System.out.println(sum); } }