#include <bits/stdc++.h>
using namespace std;
const long long lINF = 0x3f3f3f3f3f3f3f3f;
const int INF = 0x3f3f3f3f;
int n;
const int N = 110;
int a[N];
int ans;
inline int read() {
  int x = 0, neg = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') neg = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + (ch - '0');
    ch = getchar();
  }
  return x * neg;
}
int main() {
  n = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  for (int i = 1; i < n; i++) {
    if (a[i] == a[i + 1]) {
      cout << "Infinite" << endl;
      return 0;
    } else if (a[i] == 3 && a[i + 1] == 2) {
      cout << "Infinite" << endl;
      return 0;
    } else if (a[i] == 2 && a[i + 1] == 3) {
      cout << "Infinite" << endl;
      return 0;
    } else if (a[i] == 2 && a[i + 1] == 1)
      ans += 3;
    else if (a[i] == 1 && a[i + 1] == 3)
      ans += 4;
    else if (a[i] == 3 && a[i + 1] == 1)
      ans += 4;
    else if (a[i] == 1 && a[i + 1] == 2) {
      if (a[i - 1] == 3 && i > 1)
        ans += 2;
      else
        ans += 3;
    }
  }
  cout << "Finite" << endl << ans << endl;
  return 0;
}
