# ifndef ONLINE_JUDGE # define _GLIBCXX_DEBUG # endif #include using namespace std; using ll = long long; using vi = vector; using vvi = vector>; using pii = pair; # define rep(i, n) for(int i = 0; i < (int)(n); ++i) # define all(v) v.begin(), v.end() int main(){ constexpr char endl = '\n'; ios::sync_with_stdio(false); cin.tie(nullptr); cout << fixed << setprecision(10); //input(); int N;cin >> N; vi A(N); for(auto &&e : A) cin >> e; //solve(); int sum = 0; rep(i, N){ bool ok = true; rep(j, N){ if(A[i] == A[j]+1){ ok = false; break; } } if(ok) sum += A[i]; } //output(); cout << sum << endl; }