def main(): _ = int(input()) arr = sorted(list(map(int, input().split()))) ans = 0 for i, x in enumerate(arr, 1): ans += abs(i - x) print(ans)