#include <bits/stdc++.h>

using namespace std;

int counts[6];

int main(){
    
    for (int i = 1; i < 6; ++i) counts[i] = 0;
    
    int n;
    cin >> n;
//    vector<int> types(n);
    for(int types_i = 0; types_i < n; types_i++){
        int type = 0;
        cin >> type;
//       cin >> types[types_i];
        counts[type]++;
    }
    
    int best = -1;
    int seen_at = -1;
    for (int i = 1; i < 6;  ++i) {
        if (counts[i] > best) {
            best = counts[i];
            seen_at = i;
        }
    }
    cout << seen_at << '\n';
    return 0;
}