#include #include #include using namespace std; int main(int argc, char* argv[]) { int N; cin>>N; vector val(N+1); int ans=0; int x; int i; for (i=1;i<=N;i++){ cin>>val[i]; } sort(val.begin(),val.end()); for (i=1;i<=N;i++){ x=i-val[i]; if (x<0){ x=-x; } ans+=x; } cout<