#include <bits/stdc++.h>
using namespace std;
template <typename F, typename S>
ostream &operator<<(ostream &os, const pair<F, S> &p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  typename vector<T>::const_iterator it;
  for (it = v.begin(); it != v.end(); it++) {
    if (it != v.begin()) os << ", ";
    os << *it;
  }
  return os << "}";
}
template <typename T>
ostream &operator<<(ostream &os, const set<T> &v) {
  os << "[";
  typename set<T>::const_iterator it;
  for (it = v.begin(); it != v.end(); it++) {
    if (it != v.begin()) os << ", ";
    os << *it;
  }
  return os << "]";
}
template <typename T>
ostream &operator<<(ostream &os, const unordered_set<T> &v) {
  os << "[";
  typename unordered_set<T>::const_iterator it;
  for (it = v.begin(); it != v.end(); it++) {
    if (it != v.begin()) os << ", ";
    os << *it;
  }
  return os << "]";
}
template <typename F, typename S>
ostream &operator<<(ostream &os, const map<F, S> &v) {
  os << "[";
  typename map<F, S>::const_iterator it;
  for (it = v.begin(); it != v.end(); it++) {
    if (it != v.begin()) os << ", ";
    os << it->first << ": " << it->second;
  }
  return os << "]";
}
template <typename F, typename S>
ostream &operator<<(ostream &os, const unordered_map<F, S> &v) {
  os << "[";
  typename unordered_map<F, S>::const_iterator it;
  for (it = v.begin(); it != v.end(); it++) {
    if (it != v.begin()) os << ", ";
    os << it->first << ": " << it->second;
  }
  return os << "]";
}
int n, x;
void read_input() {
  cin >> n;
  int pprev = -1;
  int prev = -1;
  int points = 0;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if ((x == 2 && prev == 3) || (x == 3 && prev == 2)) {
      cout << "Infinite\n";
      return;
    }
    if ((prev == 1 && x == 2) || (prev == 2 && x == 1)) points += 3;
    if ((prev == 1 && x == 3) || (prev == 3 && x == 1)) points += 4;
    if (pprev == 3 && prev == 1 && x == 2) points--;
    pprev = prev;
    prev = x;
  }
  cout << "Finite\n" << points << "\n";
}
void solve() {}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  read_input();
  solve();
  return 0;
}
