using System; using System.Collections.Generic; using System.Linq; using static System.Console; class Program { static void Main() { ReadLine(); var A = ReadLine().Split().Select(int.Parse).ToArray(); Array.Sort(A); var a = 0; for (int i = 0; i < A.Length; i++) { a += Math.Abs(A[i] - i - 1); } WriteLine(a); } }