#include <bits/stdc++.h>
using namespace std;
int v[1009];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> v[i];
  for (int i = 1; i < n; ++i)
    if (v[i] + v[i - 1] == 5) return cout << "Infinite", 0;
  int ans(0);
  for (int i = 0; i < n; ++i) {
    if (v[i] == 1) {
      if (i) ans += v[i - 1] + (v[i - 1] != 3 || v[i + 1] != 2);
      if (i < n - 1) ans += v[i + 1] + 1;
    }
  }
  cout << "Finite\n" << ans;
  return 0;
}
