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