#include <bits/stdc++.h>
using namespace std;
const int N = 100;
vector<int> e[N];
int vis[N];
void dfs(int i, int p, int count) {}
bool comp(pair<long long, long long>& a, pair<long long, long long>& b) {
  return a.first > b.first && a.second < b.second;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int a[n];
  bool p = true;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (i) {
      if ((a[i] == 2 && a[i - 1] == 3) || (a[i] == 3 && a[i - 1] == 2) ||
          a[i] == a[i - 1])
        p = false;
    }
  }
  if (p) {
    int count = 0;
    cout << "Finite" << endl;
    for (int i = 1; i < n; i++) {
      if (a[i] == 1) {
        if (a[i - 1] == 2)
          count += 3;
        else
          count += 4;
      } else if (a[i] == 2) {
        if (a[i - 1] == 1) {
          if (i - 1) {
            if (a[i - 2] == 3)
              count += 2;
            else
              count += 3;
          } else
            count += 3;
        }
      } else {
        if (a[i - 1] == 1) count += 4;
      }
    }
    cout << count << endl;
  } else
    cout << "Infinite" << endl;
}
