#include <bits/stdc++.h>
using namespace std;
int n, a[100], points;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 1; i < n; i++) switch (a[i]) {
      case 1:
        points += a[i - 1] + 1;
        break;
      default:
        if ((a[i] == 2 && a[i - 1] == 3) || (a[i] == 3 && a[i - 1] == 2)) {
          cout << "Infinite";
          return 0;
        } else
          points += a[i] + 1;
        if (i > 1)
          if (a[i] == 2 && a[i - 1] == 1 && a[i - 2] == 3) points--;
    }
  cout << "Finite\n" << points;
}
