#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, type, q = 0, last, flag = 0;
  cin >> n;
  cin >> type;
  last = type;
  for (int i = 0; i < n - 1; i++) {
    cin >> type;
    if ((last == 1 && type == 2) || (last == 2 && type == 1)) {
      q += 3;
      q = flag ? q - 1 : q;
      flag = 0;
    } else if ((last == 1 && type == 3) || (last == 3 && type == 1)) {
      q += 4;
      flag = last == 3 ? 1 : 0;
    } else {
      cout << "Infinite";
      return 0;
    }
    last = type;
  }
  cout << "Finite" << endl;
  cout << q;
  return 0;
}
