#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const double eps = 1e-9;
const int inf = 0x3f3f3f3f;
const int maxn = 1e5 + 10;
;
int a[1111];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n / 2; ++i) scanf("%d", &a[i]);
  long long ans = 0;
  int j = 1;
  cout << 1 << endl;
  for (int i = 1; i <= n; i += 2) {
    ans += abs(a[j] - i);
    j++;
  }
  printf("%lld\n", ans);
  return 0;
}
