#include <bits/stdc++.h>
using namespace std;
int counti[6]={0};
int main(){
    int n,maxi=-1,ind,x,i;
    cin >> n;
    vector<int> types(n);
    for(int types_i = 0; types_i < n; types_i++){
       cin >>x;
       types[types_i]=x;
       counti[x]++; 
    }
    for(i=1;i<=5;i++){
        if(counti[i]>maxi){
            ind=i;
            maxi=counti[i];
        }
    }
    cout<<ind<<endl;
    // your code goes here
    return 0;
}