#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];
  }
  int ans = 0;
  int inf = 0;
  for (int i = 0; i < n - 1; i++) {
    if (a[i] * a[i + 1] == 2) {
      ans += 3;
    } else if (a[i] * a[i + 1] == 3) {
      ans += 4;
    } else {
      inf = 1;
      break;
    }
  }
  for (int i = 0; i < n - 2; i++) {
    if (a[i] == 3 and a[i + 1] == 1 and a[i + 2] == 2) {
      ans--;
    }
  }
  if (inf) {
    cout << "Infinite\n";
  } else {
    cout << "Finite\n" << ans << "\n";
  }
}
