#include <bits/stdc++.h>
using namespace std;
using LL = long long;
int main() {
  int n;
  cin >> n;
  LL ret = 0;
  int fftype = -1;
  int formerType;
  cin >> formerType;
  bool Infinite = false;
  for (int i = 1; i < n; i++) {
    int type;
    cin >> type;
    if (!Infinite) {
      if ((formerType == 2 && type == 3) || (formerType == 3 && type == 2)) {
        Infinite = true;
      } else {
        if (type == 2) {
          if (fftype == 3) {
            ret += 2;
          } else {
            ret += 3;
          }
        } else if (type == 3) {
          ret += 4;
        } else if (type == 1) {
          ret += formerType + 1;
        }
        fftype = formerType;
        formerType = type;
      }
    }
  }
  if (Infinite) {
    cout << "Infinite";
  } else {
    cout << "Finite" << endl << ret;
  }
  return 0;
}
