#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e2 + 10;
int main() {
  mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, i, in, last, ans = 0, prelast = -1;
  cin >> n;
  cin >> last;
  for (i = 1; i < n; i++) {
    cin >> in;
    if (last == 1 && in == 2) {
      ans += 3;
      if (prelast == 3) ans--;
    } else if (last == 1 && in == 3)
      ans += 4;
    else if (last == 2 && in == 1)
      ans += 3;
    else if (last == 2 && in == 3) {
      cout << "Infinite\n";
      return 0;
    } else if (last == 3 && in == 2) {
      cout << "Infinite\n";
      return 0;
    } else if (last == 3 && in == 1)
      ans += 4;
    prelast = last;
    last = in;
  }
  cout << "Finite\n";
  cout << ans;
}
