#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
inline long long int rand(long long int x, long long int y) {
  ++y;
  return (rng() % (y - x)) + x;
}
long long int n, A[200];
long long int square = 3, triangle = 2, circle = 1;
void no() {
  cout << "Infinite\n";
  exit(0);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (long long int i = 0; i < n; ++i) {
    cin >> A[i];
  }
  long long int ans = 0;
  for (long long int i = 1; i < n; ++i) {
    if (A[i] != circle && A[i - 1] != circle) no();
    if (A[i - 1] == circle) {
      if (i > 1 && A[i - 2] == square && A[i] == triangle)
        ans += 2;
      else if (A[i] == square)
        ans += 4;
      else
        ans += 3;
    } else {
      if (A[i - 1] == square)
        ans += 4;
      else
        ans += 3;
    }
  }
  cout << "Finite\n";
  cout << ans << '\n';
}
