#include <bits/stdc++.h>
using namespace std;
template <class T>
bool ckmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool ckmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long triangle = 0, square = 0, flag = 1, extra = 0;
  long long arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (int i = 1; i < n; i++) {
    if ((arr[i] + arr[i - 1]) % 5 == 0) {
      flag = 0;
    } else {
      if (arr[i] == 2) {
        triangle++;
        if (i >= 2) {
          if (arr[i - 2] == 3) {
            extra++;
          }
        }
      } else if (arr[i] == 3) {
        square++;
      } else {
        if (arr[i - 1] == 2) {
          triangle++;
        } else {
          square++;
        }
      }
    }
  }
  if (flag == 0) {
    cout << "Infinite";
  } else {
    cout << "Finite"
         << "\n";
    cout << triangle * 3 + square * 4 - extra;
  }
  return 0;
}
