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