#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7, N = 1e6 + 1;
int main() {
  long long n, ans = 0;
  cin >> n;
  long long arr[n];
  for (long long i = 0; i < n; i++) cin >> arr[i];
  for (long long i = 0; i < n - 1; i++) {
    if (arr[i] == arr[i + 1] || (arr[i] == 2 && arr[i + 1] == 3) ||
        (arr[i] == 3 && arr[i + 1] == 2)) {
      cout << "Infinite";
      return 0;
    }
  }
  for (long long i = 0; i < n - 1; i++) {
    if (arr[i] == 3 && arr[i + 1] == 1 || arr[i] == 1 && arr[i + 1] == 3)
      ans = ans + 4;
    else if (arr[i] == 2 && arr[i + 1] == 1 || arr[i] == 1 && arr[i + 1] == 2)
      ans = ans + 3;
    else
      continue;
  }
  for (long long i = 0; i < n - 2; i++) {
    if (arr[i] == 3 && arr[i + 1] == 1 && arr[i + 2] == 2) ans = ans - 1;
  }
  cout << "Finite" << endl << ans;
  return 0;
}
