#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int *arr = new int[n];
  for (int a = 0; a < n; a++) {
    cin >> arr[a];
  }
  int count = 0, specialJudge = 0;
  for (int a = n - 1; a >= 1; a--) {
    if (a - 2 >= 0 && arr[a] == 2) {
      if (arr[a - 1] == 1 && arr[a - 2] == 3) specialJudge++;
    }
    if (arr[a] == 1) {
      if (arr[a - 1] == 2)
        count += 3;
      else
        count += 4;
    } else if (arr[a] == 2) {
      if (arr[a - 1] == 1)
        count += 3;
      else {
        cout << "Infinite" << endl;
        return 0;
      }
    } else {
      if (arr[a - 1] == 1)
        count += 4;
      else {
        cout << "Infinite" << endl;
        return 0;
      }
    }
  }
  cout << "Finite\n" << count - specialJudge << endl;
  return 0;
}
