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