#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int TESTS = 1;
  while (TESTS--) {
    long long n;
    cin >> n;
    long long arr[n];
    long long ans = 0;
    for (long long i = 0; i < 2; i++) cin >> arr[i];
    for (long long i = 2; i < n; i++) {
      cin >> arr[i];
      if (arr[i] == 2 && arr[i - 1] == 1 && arr[i - 2] == 3) ans--;
    }
    for (long long i = 1; i < n; i++) {
      long long a = arr[i - 1];
      long long b = arr[i];
      long long x = min(a, b);
      long long y = max(a, b);
      if (x == 1 && y == 1) {
        cout << "Infinite";
        return 0;
      } else if (x != 1) {
        cout << "Infinite";
        return 0;
      } else {
        ans += y + 1;
      }
    }
    cout << "Finite" << endl << ans;
  }
  return 0;
}
