#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  bool flag = false;
  int sum = 0;
  for (int i = 0; i < n - 1; i++) {
    if (a[i] == 3 && a[i + 1] == 2 || a[i] == 2 && a[i + 1] == 3) {
      flag = true;
      cout << "Infinite" << endl;
      break;
    } else {
      if (a[i] == 1 && a[i + 1] == 3 || a[i] == 3 && a[i + 1] == 1)
        sum += 4;
      else
        sum += 3;
    }
  }
  for (int i = 0; i < n - 2; i++) {
    if (a[i] == 3 && a[i + 2] == 2) sum -= 1;
  }
  if (flag == false) {
    cout << "Finite" << endl;
    cout << sum << endl;
  }
}
