#include <bits/stdc++.h>
using namespace std;
unsigned long long modulo(long long a, long long b, long long n) {
  long long x = 1, y = a;
  while (b > 0) {
    if (b % 2 == 1) {
      x = (x * y) % n;
    }
    y = (y * y) % n;
    b /= 2;
  }
  return x % n;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  gcd(b, a % b);
}
void printVec(vector<int> v, int n) {
  for (int i = 0; i < n; i++) cout << v[i] + 1 << " ";
  cout << endl;
}
long long nc2(int n) { return n * (n - 1) / 2; }
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  srand(time(NULL));
  ;
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  int cnt = 0;
  for (int i = 0; i < n - 1; i++) {
    if (a[i] == 1) {
      if (a[i + 1] == 2)
        cnt += 3;
      else if (a[i + 1] == 3)
        cnt += 4;
    } else if (a[i] == 2) {
      if (a[i + 1] == 1)
        cnt += 3;
      else if (a[i + 1] == 3) {
        cout << "Infinite" << endl;
        return 0;
      }
    } else if (a[i] == 3) {
      if (a[i + 1] == 1) {
        if (i < n - 2 && a[i + 2] == 2)
          cnt += 3;
        else
          cnt += 4;
      } else if (a[i + 1] == 2) {
        cout << "Infinite" << endl;
        return 0;
      }
    }
  }
  cout << "Finite" << endl << cnt << endl;
  return 0;
}
