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