#include <bits/stdc++.h>
using namespace std;
int a[100];
int n;
void solve() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  int cnt = 0;
  bool was_trig = false;
  for (int i = 1; i < n; ++i) {
    if (a[i] == 1) {
      if (a[i - 1] == 2) {
        cnt += 3;
      } else if (a[i - 1] == 3) {
        cnt += 4;
      }
    } else if (a[i] == 2) {
      if (a[i - 1] == 3) {
        cout << "Infinite\n";
        return;
      } else if (a[i - 1] == 1) {
        if (i >= 2) {
          if (a[i - 2] == 3) {
            cnt += 2;
          } else {
            cnt += 3;
          }
        } else {
          cnt += 3;
        }
      }
    } else {
      if (a[i - 1] == 1) {
        cnt += 4;
      } else if (a[i - 1] == 2) {
        cout << "Infinite\n";
        return;
      }
    }
  }
  cout << "Finite\n";
  cout << cnt << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
