#include <bits/stdc++.h>
using namespace std;
int i, i0, n, m, a[105];
int main() {
  scanf("%d", &n);
  bool f = 0;
  scanf("%d", &a[1]);
  for (i = 2; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i - 1] == 1 && a[i] == 1) f = 1;
    if (a[i - 1] == 1 && a[i] == 2) m += 3;
    if (a[i - 1] == 1 && a[i] == 3) m += 4;
    if (a[i - 1] == 2 && a[i] == 1) m += 3;
    if (a[i - 1] == 2 && a[i] == 2) f = 1;
    if (a[i - 1] == 2 && a[i] == 3) f = 1;
    if (a[i - 1] == 3 && a[i] == 1) m += 4;
    if (a[i - 1] == 3 && a[i] == 2) f = 1;
    if (a[i - 1] == 3 && a[i] == 3) f = 1;
    if (i >= 3 && a[i - 2] == 3 && a[i - 1] == 1 && a[i] == 2) m--;
  }
  if (f)
    printf("Infinite\n");
  else
    printf("Finite\n%d\n", m);
  return 0;
}
