#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cin.exceptions(cin.failbit);
  long long int t, n, i, j, x, y, m, l, d, k;
  cin >> n;
  vector<long long int> v(n);
  for (i = 0; i < (n); ++i) cin >> v[i];
  long long int flag = 0;
  long long int ans = 0;
  for (i = 0; i < (n - 1); ++i) {
    if (v[i] * v[i + 1] == 2) {
      if (i > 0) {
        if (v[i - 1] == 3) ans--;
      }
      ans += 3;
      continue;
    }
    if (v[i] * v[i + 1] == 3) {
      ans += 4;
      continue;
    }
    flag = 1;
    break;
  }
  if (flag == 1)
    cout << "Infinite";
  else {
    cout << "Finite\n" << ans;
  }
}
