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


int main() {
    /* Enter your code here. Read input from STDIN. Print output to STDOUT */   
    int n;
    cin>>n;
    vector<int> a(n);
    vector<int> type(6);
    for(int i=0;i<n;i++){
        cin>>a[i];
        type[a[i]]++;
    }
    int max=*max_element(type.begin(),type.end());
    for(int i=1;i<6;i++){
        if(max==type[i]){
            cout<<i;
            exit(0);
        }
    }
    return 0;
}