#include <bits/stdc++.h>
using namespace std;
void solution() {
  long long n, ans = 0;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i += 1) cin >> a[i];
  for (long long i = 1; i < n; i += 1) {
    if ((a[i] == 2 && a[i - 1] == 3) || (a[i] == 3 && a[i - 1] == 2)) {
      cout << "Infinite";
      return;
    }
  }
  for (long long i = 0; i < n; i += 1) {
    if (a[i] == 2)
      ans += ((i > 0 && i < n - 1) ? 6 : 3);
    else if (a[i] == 3)
      ans += ((i > 0 && i < n - 1) ? 8 : 4);
    if (a[i] == 2 && i > 1 && a[i - 2] == 3) ans--;
  }
  cout << "Finite\n" << ans;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solution();
  return 0;
}
