var n = Number(readline());
var p = readline().split(' ').map(Number);
var b = 0,
	w = 0;

p.sort(function(a, b) {
	return a - b;
}).map(function(p, j) {
	b += Math.abs(p - ((j + 1)*2 - 1));	
	w += Math.abs(p - (j + 1)*2);
})
print(b > w ? w : b);