#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const int INF = 2000000000;
const int MOD = 1e9 + 7;


int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    int ans = 0;
    rep(i,n){
        if(a[i] <= 10) continue;
        a[i] -= 10;
        ans += a[i];
    }
    cout << ans << endl;
}

#include <bits/stdc++.h> 
using namespace std;
using namespace chrono;

#define fast_IO             ios_base::sync_with_stdio(0);   cin.tie(0);  cout.tie(0);
#define int                 long long
#define rep(i,a,b)          for (int i = a; i < b; i++)
#define rev(i,n)            for(int i=n-1;i>=0;i--)
#define pii                 pair<int,int>
#define ar(n)               array<int,n>
#define sz(n)               (int)n.size()
#define uniq(v)             (v).erase(unique(v.begin(), v.end()),(v).end())

#ifndef ONLINE_JUDGE
#define dbg(x) cerr<<#x<<" "<<x<<endl;
#else
#define dbg(x)
#endif

const int inf=1e18;
const int32_t M=1e9+7;
const int32_t mxn=1e6+1;

template <typename T> istream& operator>>(istream& in, vector <T>& a) {for (auto& i : a) in >> i; return in;}
template <typename T> ostream& operator<<(ostream& out, vector <T>& a)  {for (auto& i : a) out << i << " "; return out;}

auto clk = clock();
mt19937_64 rang(high_resolution_clock::now().time_since_epoch().count());
void run_time()
{
    cerr << endl;
    cerr << "Time elapsed: " << (double)(clock() - clk) / CLOCKS_PER_SEC << endl;
    return;
}

/*-------------------------------------solve-----------------------------------------*/


void solve()
{
    int n; cin>>n;
    vector<int> v(n); cin>>v;
    int ans=0;
    rep(i,0,n) if(v[i]>10) ans+=abs(10-v[i]);
    cout<<ans<<endl;
}

int32_t main() 
{
     fast_IO
     #ifndef ONLINE_JUDGE
        freopen("error.txt","w",stderr);
     #endif
    int t = 1;
    // cin >> t;
    
    while (t--) 
        solve();
        run_time();
    return 0;
}