#include <bits/stdc++.h>
using namespace std;
char buffer[500];
string itos(int num) {
  sprintf(buffer, "%d", num);
  return buffer;
}
int stoi(string inp) { return atoi(inp.c_str()); }
float stof(string inp) { return (float)atof(inp.c_str()); }
double stod(string inp) { return (double)atof(inp.c_str()); }
const double eps = 1e-8;
int main() {
  int n;
  cin >> n;
  vector<int> v;
  int b;
  for (int i = 0; i < n; i++) {
    cin >> b;
    v.push_back(b);
  }
  sort((v).begin(), (v).end());
  long long int ret = 0;
  int a = n;
  for (int i = n - 1; i >= 0; i--) {
    if (v[i] != a) {
      ret += abs(a - v[i]);
    }
    a--;
  }
  cout << ret << endl;
  return 0;
}
