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