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