#include using namespace std; int main() { int n; cin >> n; int sumA = 0; for (int i = 0; i < n; i++) { int a; cin >> a; sumA += a; } int sumB = 0; for (int i = 1; i <= n; i++) { sumB += i; } cout << abs(sumA - sumB) << endl; }