#include <iostream>
#include <deque>
#include <algorithm>
#include <utility>
using namespace std;

int main() {
    int n;
    cin >> n;
    deque<int> types(n);
    deque<pair<int,int> > count(7);
    for (int i = 1;i <= 5 ; i++) {
	count[i] = make_pair(0, i);
    }

    
    for (int& i : types){
	cin >> i;
	count[i].first++;
    }
    stable_sort(count.begin(), count.end(), [] (auto a ,auto b){
	    return a.first > b.first;
	});
    cout << count.front().second << endl;
    
}