#include <bits/stdc++.h>
using namespace std;
const int MAXN = 110;
int v[MAXN];
int main() {
  int n;
  cin >> n;
  bool f = false;
  int r = 0;
  for (int i = 1; i <= n; i++) {
    cin >> v[i];
    if (i > 1 && ((v[i] == 3 && v[i - 1] == 2) || (v[i] == 2 && v[i - 1] == 3)))
      f = true;
    if (i > 2 && (v[i] == 2 && v[i - 2] == 3))
      r += 2;
    else if (i > 1) {
      if ((v[i] == 1 && v[i - 1] == 2) || (v[i] == 2 && v[i - 1] == 1)) r += 3;
      if ((v[i] == 1 && v[i - 1] == 3) || (v[i] == 3 && v[i - 1] == 1)) r += 4;
    }
  }
  if (f == true) {
    cout << "Infinite" << endl;
    return 0;
  }
  cout << "Finite" << endl;
  cout << r << endl;
}
