#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 7;
long long a, b, c, d;
long long n, m, k, t;
long long ans, cur, cnt, ind;
long long sum, val, res, last;
long long mx = -1e18, mn = 1e18;
long long arr[N];
vector<long long> v;
bool h[N];
string str;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  for (long long i = 0; i < (long long)n; i++) {
    cin >> arr[i];
  }
  for (long long i = 0; i < (long long)n - 1; i++) {
    if (arr[i] + arr[i + 1] == 5) {
      cout << "Infinite";
      return 0;
    }
    if (arr[i] == 1) {
      if (arr[i + 1] == 2) {
        sum += 3;
      } else {
        sum += 4;
      }
    } else if (arr[i] == 2) {
      if (arr[i + 1] == 1) {
        sum += 3;
      } else {
        sum + 4;
      }
    } else {
      sum += 4;
    }
  }
  for (long long i = 0; i < (long long)n - 2; i++) {
    if (arr[i] == 1 && arr[i + 1] == 3 && arr[i + 2] == 2) {
      sum -= 2;
    } else if (arr[i] == 3 && arr[i + 1] == 1 && arr[i + 2] == 2) {
      sum--;
    }
  }
  cout << "Finite\n" << sum;
}
