#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int prev = -1;
  int pprev = -1;
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    if ((prev == 3 && x == 2) || (prev == 2 && x == 3)) {
      printf("Infinite\n");
      return 0;
    }
    if ((prev == 2 && x == 1)) cnt += 3;
    if (prev == 1 && x == 2) {
      if (pprev == 3) {
        cnt += 2;
      } else {
        cnt += 3;
      }
    }
    if ((prev == 3 && x == 1) || (prev == 1 && x == 3)) cnt += 4;
    pprev = prev;
    prev = x;
  }
  printf("Finite\n%d\n", cnt);
  return 0;
}
