#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  int count = 0;
  for (int i = 1; i < n; i++)
    if (a[i] + a[i - 1] < 5) {
      if (i >= 2 && a[i] == 2 && a[i - 1] == 1 && a[i - 2] == 3) count--;
      count += a[i] + a[i - 1];
    } else {
      count = -1;
      break;
    }
  if (count < 0) {
    cout << "Infinite" << endl;
  } else {
    cout << "Finite" << endl;
    cout << count << endl;
  }
  return 0;
}
