#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
  }
  long long ans = 0;
  for (long long i = 1; i < n; i++) {
    if (v[i] != 1 && v[i - 1] != 1) {
      cout << "Infinite" << '\n';
      return;
    }
    if (v[i] == 2 || v[i - 1] == 2) {
      ans += 3;
    }
    if (v[i] == 3 || v[i - 1] == 3) {
      ans += 4;
    }
    if (i != n - 1) {
      if (v[i - 1] == 3 && v[i] == 1 && v[i + 1] == 2) {
        ans--;
      }
    }
  }
  cout << "Finite" << '\n';
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int tc;
  tc = 1;
  for (int i = 1; i <= tc; i++) {
    solve();
  }
  return 0;
}
