//Mahir Ratanpara (DA-IICT)
#include<bits/stdc++.h>
using namespace std;
#define Ff(i,a,n) for(i=a;i<n;i++)
#define Fr(i,a,n) for(i=a;i>n;i--)
#define ll long long
#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define pb push_back
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
typedef pair<ll, ll>	pa;
typedef vector<ll>		vc;
typedef vector<pa>		vp;
typedef vector<vc>		vvc;
int mpow(int base, int exp); 
void ipgraph(ll n,ll m);
void dfs(int u, int par);
const int mod = 1000000007;
const int N = 3e5, M = N;
//=======================

vc g[N];

int main() {
    FAST;
    ll t, i, j, k, p, q, r, x, y, u, v, n, m;
    cin>>n;
	vc a(n);
	Ff(i,0,n)
	cin>>a[i];

	ll ans=0;
	sortall(a);
	Ff(i,0,n)
	{
		Ff(j,i+1,n)
		{
			Ff(k,j+1,n)
			{
				if (a[i] != a[j] && a[j] != a[k] && a[k] < a[i] + a[j])
                    ans++;
			}
		}
	}
	cout<<ans;
    return 0;
}

int mpow(int base, int exp) {
  base %= mod;
  int result = 1;
  while (exp > 0) {
    if (exp & 1) result = ((ll)result * base) % mod;
    base = ((ll)base * base) % mod;
    exp >>= 1;
  }
  return result;
}

void ipgraph(ll n, ll m){
	int i, u, v;
	while(m--){
		cin>>u>>v;
		g[u-1].pb(v-1);
		g[v-1].pb(u-1);
	}
}

void dfs(int u, int par){
	for(int v:g[u]){
		if (v == par) continue;
		dfs(v, u);
	}
}
#include <iostream>
using namespace std;

int func(int x, int y, int z){
//  cout << x << " " << y << " " << z << endl;
  if (x==y||y==z||z==x) return false;
  if (x+y>z&&y+z>x&&z+x>y){
//    cout << "ok" << endl;
    return true;
  }
  return false;
}

int main(void){
  int n,ans;
  int len[200];
  
  cin >> n;
  for (int i=0; i<n; i++) cin >> len[i];
  ans = 0;
  for (int i=0; i<n; i++){
    for (int j=i+1; j<n; j++){
      for (int k=j+1; k<n; k++){
        ans += func(len[i], len[j], len[k]);
      }
    }
  }
  cout << ans << endl;
  return 0;
}