import java.io.File; import java.io.FileNotFoundException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Scanner; public class Main { public static void main(String[] args) throws FileNotFoundException { new Main().run(); } void run() throws FileNotFoundException { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[] A = new int[N]; if (!(1 <= N && N <= 50)) throw new AssertionError(); for (int i = 0; i < N; ++i) { A[i] = sc.nextInt(); if (!(1 <= A[i] && A[i] <= N)) throw new AssertionError(); } Arrays.sort(A); int ans = 0; for (int i = 0; i < N; ++i) { ans += Math.abs(A[i] - (i + 1)); } System.out.println(ans); } void tr(Object... objects) { System.out.println(Arrays.deepToString(objects)); } }