#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 0;
  bool flag = false;
  int a[105];
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 1; i < n; i++) {
    if (a[i] == 2) {
      if (a[i - 1] == 1) {
        if (i >= 2 && a[i - 2] == 3)
          ans += 2;
        else
          ans += 3;
      } else {
        flag = true;
        break;
      }
    } else if (a[i] == 1) {
      if (a[i - 1] == 2)
        ans += 3;
      else if (a[i - 1] == 3)
        ans += 4;
      else {
        flag = true;
        break;
      }
    } else {
      if (a[i - 1] == 1)
        ans += 4;
      else {
        flag = true;
        break;
      }
    }
  }
  if (flag)
    puts("Infinite");
  else {
    puts("Finite");
    cout << ans << endl;
  }
  return 0;
}
