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

int main() {
  int num, nuts, x = 0, y = 0;
  cin >> num;

  for (int i = 1; i <= num; i++){
    cin >> nuts;

    if (nuts > 10){
      x = nuts - 10;
      //y += x;
    }

    else{
      continue;
    }

    y += x;
  
  }

  cout << y << endl;

  
return 0;
  
}
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main() {
  string s;
  cin>>s;
  ll n=s.size();
  map<char,ll>p;
  ll r=0;
  for(ll i=n-1;i>0;i--) {
    if(s[i-1]==s[i]){
      r+=(n-i-1-p[s[i]]);
      for (ll j=0;j<26;j++) p[('a'+j)] = 0;
      p[s[i]]=n-i;
    }else p[s[i]]++;
  }
  cout<<r<<'\n';
}