

def abss(x):
    return x if x > 0 else -x


def chess(current):
    sum = 0
    for i in range(len(current)):
        sum += abss(current[i] - i*2 - 1)

    return sum


n = int(raw_input())
print(chess([int(x) for x in raw_input().split(' ')]))
