#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n;
  cin >> n;
  vector<long int> v;
  for (long int i = 0; i < n; i++) {
    long int x;
    cin >> x;
    v.push_back(x);
  }
  int z = 1;
  int y = 1;
  long long int x = 0;
  for (long int i = 0; i < n - 1; i++) {
    y = 1;
    if ((v[i] == 3 && v[i + 1] == 2) || (v[i] == 2 && v[i + 1] == 3)) {
      cout << "Infinite" << endl;
      z = 1;
      break;
    } else {
      if (v[i - 1] == 3) {
        y = 0;
      }
      z = 0;
      if (v[i] == 1 && v[i + 1] == 2) {
        if (y == 0)
          x = x + 2;
        else
          x = x + 3;
      } else if (v[i] == 2 && v[i + 1] == 1) {
        x = x + 3;
      } else if ((v[i] == 3 && v[i + 1] == 1) || (v[i] == 1 && v[i + 1] == 3))
        x = x + 4;
    }
  }
  if (z == 0) {
    cout << "Finite" << endl;
    cout << x << endl;
  }
  return 0;
}
