#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
#define rep(i,a,b) for (int i = (int)(a); i < (int)(b); i++)

ll compute(ll a){
    ll ans =0;
    while(a != 0){
        ans += a-1;
        a--;
    }
    return ans;

}

int main(){
    
    ll N; cin >> N;
    vector<ll> A(N);
    rep(i,0,N){
        cin >> A.at(i);
    }
    sort(A.begin(),A.end());
    ll cnt =0;
    ll sub_cnt =0;
    rep(i,1,N){
        if(A.at(i)==A.at(i-1)){
            sub_cnt++;
        }
        else{
            cnt += compute(sub_cnt+1);
            sub_cnt=0;
        }
    }
    if(sub_cnt!=0){
        cnt += compute(sub_cnt+1);
    }
    cout << compute(N) - cnt << endl;
   

}
    

    

#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include <cassert>
#include <numeric>
#include <unordered_map>
typedef long long ll;
#define FOR(i, a, b) for(int i=(a); i<(b);i++)
#define REP(i, n) for(int i=0; i<(n);i++)
#define ROF(i, a, b) for(int i=(b-1); i>=(a);i--)
#define PER(i, n) for(int i=n-1; i>=0;i--)
using namespace std;


int main() {
  unordered_map<string, int> map;
  ll n;
  cin >> n;
  vector<string> s;
  s.resize(n);

  REP(i, n) {
    cin >> s[i];
  }
  ll ans = 0;

  REP(i, n) {
    if (s[i][0] == '!') {
      map[s[i]] = 1;
    }
  }
  REP(i, n) {
    if (s[i][0] != '!') {
      string tmp = '!' + s[i];
      if (map[tmp] == 1) {
        cout << s[i];
        return 0;
      }
    }
  }

  cout << "satisfiable";

  return 0;
}