#include <bits/stdc++.h>
using namespace std;
int a[200];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  int prev, cur;
  int cnt = 0;
  bool inf = false;
  for (int i = 1; i < n; ++i) {
    cur = a[i];
    prev = a[i - 1];
    if (prev == 1) {
      if (cur == 2) {
        cnt += 3;
      } else {
        cnt += 4;
      }
    }
    if (prev == 2) {
      if (cur == 1) {
        cnt += 3;
      } else {
        inf = true;
        break;
      }
    }
    if (prev == 3) {
      if (cur == 2) {
        inf = true;
        break;
      } else {
        if (i < n - 1 && a[i + 1] == 2) --cnt;
        cnt += 4;
      }
    }
  }
  if (inf)
    cout << "Infinite" << endl;
  else
    cout << "Finite\n" << cnt << endl;
  return 0;
}
