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