#include <iostream>
#include <vector>

using namespace std;

#define rep(i,n) for(int i=0;i<(n);i++)
#define sf(n)       scanf("%d", &n)

int main() {
    int n;
    sf(n);

    vector<int> prices(n);
    rep(i, n) sf(prices[i]);

    int price_today = prices[0];
    int count = 1;
    prices.erase(prices.begin());

    while (prices.size() > 0 && prices[0] > price_today) {
        count++;
        prices.erase(prices.begin());
    }

    if (count == n) {
        printf("infinity\n");
    }
    else {
        printf("%d\n", count);
    }

    return 0;
}