#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  int f = 0, ans = 0;
  for (int i = 0; i < n - 1; i++) {
    if (a[i] == 1) {
      if (a[i + 1] == 2)
        ans += 3;
      else
        ans += 4;
    } else if (a[i] == 2) {
      if (a[i + 1] == 3)
        f++;
      else
        ans += 3;
    } else {
      if (a[i + 1] == 2)
        f++;
      else {
        ans += 4;
      }
    }
  }
  int cnt = 0;
  for (int i = 0; i < n - 2; i++) {
    if (a[i] == 3 and a[i + 1] == 1 and a[i + 2] == 2) cnt++;
  }
  if (f > 0)
    cout << "Infinite";
  else {
    cout << "Finite" << '\n';
    cout << ans - cnt;
  }
  return 0;
}
