while True:
	try:
		def solution(n):
			a = list(map(int, input().split()))
			a.sort()
			e = [i for i in range(1,n,2)]
			o = [i for i in range(2,n+1, 2)]
			ans = 0
			for i in range(n//2):
				ans += abs(e[i]-a[i])
			anst = 0
			for i in range(n//2):
				anst += abs(o[i]-a[i])
			print(min(ans, anst))
			
			
		def read():
			n = int(input())
			solution(n)
			
		if __name__ == "__main__":
			read()
	except EOFError:
		break