#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int last;
  int pre = -1;
  cin >> last;
  int nxt;
  int ans = 0;
  for (int i = 1; i < n; i++) {
    cin >> nxt;
    if (nxt * last > 3) {
      return cout << "Infinite\n", 0;
    }
    ans += (last * nxt + 1);
    if (pre == 3 and nxt == 2) ans--;
    pre = last;
    last = nxt;
  }
  cout << "Finite\n";
  cout << ans << endl;
}
