import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import numpy as np N = int(readline()) A = np.array(read().split(),np.int64) A.sort() x = np.arange(1,N+1) - A answer = np.abs(x).sum() print(answer)