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