#include <bits/stdc++.h>
using namespace std;
int a[105];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  bool flag = true;
  int cnt = 0;
  for (int i = 1; i < n && flag; i++) {
    if (a[i] == 1) {
      if (a[i - 1] == 1) flag = false;
      if (a[i - 1] == 2) cnt += 3;
      if (a[i - 1] == 3) cnt += 4;
    } else if (a[i] == 2) {
      if (a[i - 1] == 1) {
        if (i >= 2 && a[i - 2] == 3)
          cnt += 2;
        else
          cnt += 3;
      }
      if (a[i - 1] == 2) flag = false;
      if (a[i - 1] == 3) flag = false;
    } else {
      if (a[i - 1] == 1) cnt += 4;
      if (a[i - 1] == 2) flag = false;
      if (a[i - 1] == 3) flag = false;
    }
  }
  if (flag) {
    cout << "Finite" << endl;
    cout << cnt << endl;
  } else
    cout << "Infinite" << endl;
}
