n = int(input()) a_list = list(map(int,input().split())) right_list = list(range(1, n + 1)) sorted_a = sorted(a_list) res = 0 for i in range(n): res += abs(right_list[i] - sorted_a[i]) print(res)