#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cnt = 0, flg = 0;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 1; i < n; i++) {
    if ((a[i] == 2 && a[i - 1] == 3) || (a[i] == 3 && a[i - 1] == 2))
      flg = 1;
    else if (a[i] == 2 && a[i - 1] == 1)
      cnt += 3;
    else if (a[i] == 3 && a[i - 1] == 1)
      cnt += 4;
    else if (a[i] == 1 && a[i - 1] == 2)
      cnt += 3;
    else if (a[i] == 1 && a[i - 1] == 3)
      cnt += 4;
    if (a[i] == 1 && a[i - 1] == 3 && a[i + 1] == 2) cnt -= 1;
  }
  if (flg)
    cout << "Infinite" << endl;
  else {
    cout << "Finite" << endl;
    cout << cnt << endl;
  }
}
