C++简洁代码:

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n, temp, res = 0;
    cin >> n;
    while (cin >> temp) 
        res += temp - 1;
    cout << res << endl;
    return 0;
}