#include <bits/stdc++.h>
using namespace std;
string alpha = "abcdefghijklmnopqrstuvwxyz";
int MOD = 1000000007;
const int N = 100100;
int main() {
  vector<int> vec;
  int n, x;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &x), vec.push_back(x);
  int ans = 0;
  for (int i = 1; i < n; ++i) {
    if (vec[i - 1] == 2) {
      if (vec[i] == 1)
        ans += 3;
      else
        return puts("Infinite");
    } else if (vec[i - 1] == 1) {
      if (vec[i] == 2) {
        ans += 3;
        if (i - 2 >= 0) {
          if (vec[i - 2] == 3) ans--;
        }
      } else if (vec[i] == 3)
        ans += 4;
      else
        return puts("Infinite");
    } else {
      if (vec[i] == 1)
        ans += 4;
      else
        return puts("Infinite");
    }
  }
  puts("Finite");
  cout << ans;
  return 0;
}
