n = int(input()) num = [ int(v) for v in input().split() ] template = [i+1 for i in range(n)] num.sort() print(sum([abs(num[i] - template[i]) for i in range(n)]))