#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1000000005;
int n, ans = 0;
int a[105];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cin >> n;
  a[0] = 0;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    if (a[i] + a[i - 1] == 5) {
      cout << "Infinite" << endl;
      return 0;
    }
  }
  for (int i = 2; i <= n; i++) {
    if (a[i - 1] == 1) {
      if (a[i] == 3)
        ans += 4;
      else {
        ans += 3;
        if (a[i - 2] == 3) ans--;
      }
    } else if (a[i - 1] == 2) {
      ans += 3;
    } else
      ans += 4;
  }
  cout << "Finite" << endl;
  cout << ans << endl;
  return 0;
}
