using System; using System.Linq; using static System.Console; class Program { static void Main(string[] args) { var n = int.Parse(ReadLine()); var inputArr = ReadLine().Split(' '); var nums = inputArr.Select(s => int.Parse(s)).ToArray(); Array.Sort(nums); var cnt = 0; var i = 1; foreach(var x in nums) { if(x > i) { cnt += x - i; }else if(x < i) { cnt += i - x; } i++; } WriteLine(cnt); } }