// AtCoder Beginner Contest 204
// B - 
#include <iostream>
#include <vector>

int main(int argc, char *argv[]);
int main(int argc, char *argv[])
{
  unsigned short N;
  std::cin >> N;

  std::vector<unsigned short> nuts(N);
  for(unsigned short i=0; N>i; i++)
    std::cin >> nuts[i];

  std::vector<unsigned short>::const_iterator it=nuts.cbegin();
  const std::vector<unsigned short>::const_iterator end=nuts.cend();

  unsigned long sum=0;
  while(end != it)
    {
      if(10 < *it)
        sum += *it-10;
      it++;
    }

  std::cout << sum << std::endl;

  return 0;
}

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

#define ll long long
#define ld long double
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define F first
#define S second
#define nl "\n"
#define pll pair<ll, ll>
#define all(v) (v).begin(), (v).end()
#define decimal(n) cout << fixed << setprecision(n)
#define mod 1000000007
// #define mod 998244353
#define pi 3.14159265358979323846

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll t = 1, tc;
    //cin >> t;
    for (tc = 1; tc <= t; tc++)
    {
        ll n,i,x,s=0;
        cin>>n;
        for(i=0;i<n;i++){
            cin>>x;
            s+=max(0ll,x-10);
        }
        cout<<s;
    }
    return 0;
}