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