#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int maxN = 100 + 9;
int n;
long long a[maxN];
void read() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
}
int check(int in, int out) {
  if (in == 1) {
    if (out == 2) {
      return 3;
    }
    return 4;
  }
  if (in == 2) {
    if (out == 1) return 3;
    return INF;
  }
  if (in == 3) {
    if (out == 1) return 4;
    return INF;
  }
}
void solv() {
  int ans = 0;
  reverse(a, a + n);
  for (int i = 0; i + 1 < n; i++) {
    int cur = check(a[i], a[i + 1]);
    if (i + 2 < n) {
      if (a[i] == 2 && a[i + 1] == 1 && a[i + 2] == 3) cur--;
    }
    if (cur + 1 >= INF) {
      cout << "Infinite\n";
      return;
    }
    ans += cur;
  }
  cout << "Finite\n";
  cout << ans << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  read();
  solv();
  return 0;
}
