#include <bits/stdc++.h>
#define reg register
#define ll long long
#define ull unsigned long long
using namespace std;
const int MAXN = 110;
int n;
ll a[MAXN];
void work() {
  scanf("%d", &n);
  for(reg int i = 1; i <= n; ++i) scanf("%lld", &a[i]);
  int ans = 0;
  for(reg int i = 1; i <= n; ++i) {
    for(reg int j = i + 1; j <= n; ++j) {
      for(reg int k = j + 1; k <= n; ++k) {
        if(a[i] != a[j] && a[j] != a[k] && a[i] != a[k]) {
          if(a[i] + a[j] > a[k] && a[i] + a[k] > a[j] && a[j] + a[k] > a[i]) ++ans;
        }
      }
    }
  }
  printf("%d\n", ans);
}
signed main() {
  int _ = 1;
  // scanf("%d", &_);
  while(_--) {
    work();
  }
  return 0;
}

#include<bits/stdc++.h>
// Begin Header {{{
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i,n) for(ll i=0; i<n; i++)
#define loop(i, j, n) for(ll i=j; i<n; i++)
#define all(x) (x).begin(), (x).end()
constexpr int INF  = 0x3f3f3f40;
const long long mod=1e9+7;
const long double PI = acos(0);
template <class T>void UNIQUE(vector<T> &x){
	sort(all(x));
	x.erase(unique(all(x)), x.end());
}

// }}} End Header
int main() {
	int n, ans = 0;
	cin >> n;
	vector<ll> l(n);
	map<ll, ll> dict;
	rep(i,n){
		cin >> l[i];
		dict[l[i]]++;
	}
	UNIQUE(l);
	if(l.size()<3){
		cout << 0 << endl;
		return 0;
	}
	rep(i,l.size()-2){
		loop(j, i+1, l.size()-1){
			loop(k, j+1, l.size()){
				if(l[i]+l[j] > l[k]){
					//cout << l[i] << l[j] << l[k] << endl;
					ans+=(dict[l[i]]*dict[l[j]]*dict[l[k]]);
				}		
			}
		}
	}
	cout << ans << endl;

	return 0;
}