#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, flag = 1, sum = 0;
  cin >> n;
  int a[n];
  cin >> a[0];
  if (a[0] == 2) sum += 3;
  if (a[0] == 3) sum += 4;
  for (int i = 1; i < n; i++) {
    cin >> a[i];
    if (((a[i] == 2) && (a[i - 1] == 3)) || ((a[i] == 3) && (a[i - 1] == 2))) {
      flag = 0;
      cout << "Infinite";
      break;
    }
    if (i >= 2 && (a[i - 2] == 3) && a[i] == 2) sum--;
    if (a[i] == 2) sum += 6;
    if (a[i] == 3) sum += 8;
  }
  if (a[n - 1] == 2) sum = sum - 3;
  if (a[n - 1] == 3) sum = sum - 4;
  if (flag == 1) cout << "Finite" << endl << sum;
  return 0;
}
