#include <bits/stdc++.h>
#define int long long
using namespace std;
/*const int maxn = 1e6+7;
const int MAXN = maxn / 2;*/
signed main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n,maxnum = 0;
string maxn = "0",x;
cin >> n;
for (int i = 1; i <= n; i++)
{
cin >> x;
if (x > maxn) maxn = x,maxnum = i;
}
cout << maxnum;
return 0;
}