
#include<bits/stdc++.h>
#define fast ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define endl "\n";
#pragma GCC optimize "trapv"
#define sz(v) ((int)(v).size())
const int INF = 1e9;
const int mx =1e6+100;
const int mod =1e9+7;
#define MAX 100005
using namespace std;
typedef long long int ll;
// for policy based DS
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
 
// #define ordered_set tree<pair<int,int>, null_type,less<pair<int,int> >, rb_tree_tag,tree_order_statistics_node_update>
// #define os_find(k) find_by_order(k)
// #define os_order(k) order_of_key(k)
 // #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
vector<int>special;
unordered_map<int,int>ump;

int main()
{
    fast
    int n;
    cin>>n;
    map<int,int>mp;
    ll ans =0;
    for(int i=0;i<n;i++)
    {
        int x;
        cin>>x;
        mp[x]++;
        ans += (i+1)-mp[x];
    }
    cout<<ans<<endl;
    return 0;
}

#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int main(void) {
	int N;
	cin >> N;
	vector<string> S;
	for (int i = 0; i < N; i++) {
		string s;
		cin >> s;
		if (s[0] == '!') {
			s = s.substr(1, s.size() - 1) + '!';
		}
		S.push_back(s);
	}
	sort(S.begin(), S.end());
	for (int i = 1; i < N; i++) {
		if (S[i][S[i].size() - 1] == '!' && S[i].substr(0, S[i].size() - 1) == S[i - 1]) {
			cout << S[i - 1] << endl;
			return 0;
		}
	}
	cout << "satisfiable\n";
	return 0;
}