#include <iostream>
using namespace std;
int main() {
  int n;
  cin >> n;
  int c = 0;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if (a >= 10) c += (a - 10);
  }
  cout << c;
  return 0;
}
#pragma GCC optimize ("trapv")
#include <bits/stdc++.h>
#include<algorithm>
#include <vector>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<string.h>
using namespace std;
#define pb push_back
#define all(v) v. begin(),v. end()
#define  rep(i,n,v) for(i=n;i<v;i++)
#define per(i,n,v) for(i=n;i>v;i--)
#define ff first 
#define ss second 
#define pp pair<ll,ll>
#define ll  long long
#define endl '\n'
void solve()
{
  ll   n, a, b=-1,m=0, c=0,k=0, i, j, l=1e9+7;
  string s;
  cin>>n;
  ll ar[n];
  rep(i, 0,n)
  {
    cin>>ar[i];
    if(ar[i]>10) { ar[i]-=10;k+=ar[i];}
  }
  cout<<k;
} 
int main()
{
 ios_base::sync_with_stdio(false);
  cin. tie(0);cout. tie(0);
    ll t=1;
  // sieve();//pre();
 // cin>>t;
    while(t--)
    {
      solve();
    }
    return 0;
}