let n = Int(readLine()!)! let a = readLine()!.split(separator: " ").map{Int($0)!}.sorted(by: <) var c = 0//a.reduce(0){$0 + $1} for i in 1...n{ c += abs(i - a[i - 1]) } print(c)