#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a, i = 0, p = 0, pp = 0;
  long long x = 0;
  while (i != n) {
    cin >> a;
    if ((p == 2 && a == 3) || (p == 3 && a == 2)) {
      cout << "Infinite";
      return 0;
    } else {
      if (p == 2 && a == 1)
        x += 3;
      else if ((p == 1 && a == 3) || (p == 3 && a == 1))
        x += 4;
      else if (p == 1 && a == 2 && pp == 3)
        x += 2;
      else if (p == 1 && a == 2 && pp != 3)
        x += 3;
    }
    pp = p;
    p = a;
    i++;
  }
  cout << "Finite\n" << x;
  return 0;
}
