#include <bits/stdc++.h>
#pragma disable : 4996)
using namespace std;
const long long inf = 0x7f7f7f7f;
long long GCD(long long a, long long b) { return 0 == b ? a : GCD(b, a % b); }
const long long mod = 1e9 + 7;
const double pi = acos(-1);
int s[100000];
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> s[i];
  int sum = 0;
  for (int i = 0; i < n - 1; i++) {
    if ((s[i] == 2 && s[i + 1] == 1) || (s[i] == 1 && s[i + 1] == 2))
      sum += 3;
    else if ((s[i] == 2 && s[i + 1] == 3) || (s[i] == 3 && s[i + 1] == 2)) {
      cout << "Infinite";
      return 0;
    } else
      sum += 4;
  }
  for (int i = 0; i < n - 2; i++)
    if (s[i] == 3 && s[i + 1] == 1 && s[i + 2] == 2) sum -= 1;
  cout << "Finite" << endl;
  cout << sum;
}
