// yukicoder: No.693 square1001 and Permutation 2 // 2019.5.6 bal4u #include #include #if 1 #define gc() getchar_unlocked() #else #define gc() getchar() #endif int in() // 非負整数の入力 { int n = 0, c = gc(); do n = 10 * n + (c & 0xf), c = gc(); while (c >= '0'); return n; } #define ABS(x) ((x)>=0?(x):-(x)) int cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; } int a[53]; int N; int main() { int i, ans; N = in(); for (i = 1; i <= N; i++) a[i] = in(); qsort(a+1, N, sizeof(int), cmp); ans = 0; for (i = 1; i <= N; i++) ans += ABS(a[i] - i); printf("%d\n", ans); return 0; }