#include <bits/stdc++.h>
using namespace std;
void solve() {
  long n;
  cin >> n;
  vector<long> arr(n);
  long cnt = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (i > 1) {
      if (arr[i] == 2 && arr[i - 1] == 1 && arr[i - 2] == 3) {
        cnt++;
      }
    }
  }
  long ans = 0;
  bool y = 1;
  for (int i = 1; i < n; i++) {
    if (arr[i] == 3 && arr[i - 1] == 2) {
      y = 0;
      break;
    } else if (arr[i] == 2 && arr[i - 1] == 3) {
      y = 0;
      break;
    } else {
      if (arr[i] == 1) {
        if (arr[i - 1] == 2) {
          ans = ans + 3;
        } else {
          ans = ans + 4;
        }
      } else {
        if (arr[i] == 2) {
          ans = ans + 3;
        } else {
          ans = ans + 4;
        }
      }
    }
  }
  if (y) {
    cout << "Finite\n" << ans - cnt << "\n";
  } else {
    cout << "Infinite\n";
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long t = 1;
  while (t--) solve();
}
