#include <bits/stdc++.h>

using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> types(n);int a[6]={0,0,0,0,0,0};
    for(int types_i = 0; types_i < n; types_i++){
       cin >> types[types_i];a[types[types_i]]++;
    }
    int ans=0,fq=0;
    for(int i=1;i<6;i++)
        {
        
        if(a[i]>fq)
            {
            fq=a[i];ans=i;
        }
    }
    cout<<ans<<"\n";
    // your code goes here
    return 0;
}