#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, num, before, points = 0;
  cin >> n;
  int nums[n];
  cin >> before;
  nums[0] = before;
  for (int i = 1; i < n; i++) {
    cin >> num;
    nums[i] = num;
    if (before + num == 5) {
      cout << "Infinite";
      return 0;
    } else if (before + num == 3) {
      points += 3;
    } else if (before + num == 4) {
      points += 4;
    }
    before = num;
  }
  for (int i = 0; i < n; i++) {
    if (nums[i] == 3 && nums[i + 1] == 1 && nums[i + 2] == 2) {
      points--;
    }
  }
  cout << "Finite\n" << points;
}
