#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define pf push_front
#define ft first
#define sec second
#define pr pair<int,int>
#define ISCC ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std; 
int t ,n ,m ,a ,sum;
string s;
int main()
{
	cin >> n;
	for(int i=0 ;i<n ;i++)
	{
		cin >> a;
		sum += max(0 ,a-10);
	}
	cout << sum;
	return 0;
}
/***   -God give me the power −   ***/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void test()
{
    int n;
    cin>>n;
    vector <ll> arr(n);
    map <ll,int> mp;
    ll ans=0;
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
        mp[arr[i]]++;
    }
    for(int i=0;i<n;i++)
    {
        mp[arr[i]]--;
        ans+=max(0,n-i-1-mp[arr[i]]);
    }
    cout<<ans<<"\n";

}
int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int t=1;
    //cin>>t;
    while(t--)
    {
        test();
    }
    return 0;
}

