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