#!/usr/bin/env python3
from sys import exit

n = int(input())
nums = [int(x) for x in input().split()]
p0 = nums[0]

for i in range(1, n):
    if (nums[i] <= p0):
        print(i)
        exit(0)

print("infinity")