#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
const int INF2 = 0x3f3f3f3f;
const long long INF64 = 1e18;
const double INFD = 1e30;
const double EPS = 1e-6;
const double PI = 3.14159265;
const long long MOD = 998244353;
template <typename T>
inline T read() {
  T X = 0, w = 0;
  char ch = 0;
  while (!isdigit(ch)) {
    w |= ch == '-';
    ch = getchar();
  }
  while (isdigit(ch)) X = (X << 3) + (X << 1) + (ch ^ 48), ch = getchar();
  return w ? -X : X;
}
const int MAXN = 300005;
int n, m, k;
int CASE = 1;
struct Query {
  int x, id;
  bool operator<(const Query& a) const { return a.x > x; }
};
struct Edge {
  int u, v, w;
  bool operator<(const Edge& a) const { return w < a.w; }
};
Query queries[MAXN];
vector<Edge> edges;
long long res[MAXN];
class UnionFind {
 public:
  UnionFind() {}
  int find(int x) {
    if (parent[x] == x)
      return x;
    else
      return parent[x] = find(parent[x]);
  }
  bool same(int x, int y) { return find(x) == find(y); }
  void join(int x, int y) {
    x = find(x);
    y = find(y);
    if (x == y) return;
    if (rank[x] < rank[y]) swap(x, y);
    parent[y] = x;
    rank[x] += rank[y];
  }
  void clear(int n) {
    for (int i = 0; i <= n; i++) {
      parent[i] = i;
      rank[i] = 1;
    }
  }
  int parent[MAXN];
  int rank[MAXN];
};
int arr[MAXN];
inline long long comb(long long x) { return x * (x - 1LL) / 2LL; }
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    arr[i] = read<int>();
  }
  long long ans = 0;
  sort(arr, arr + n);
  for (int i = 0; i < n; i++) {
    ans += abs(arr[i] - i - 1);
  }
  printf("%lld", ans);
  return 0;
}
