#define _CRT_SECURE_NO_WARNINGS
#define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING
#include <bits/stdc++.h>
using namespace std;
int a[105], n;
int main()
{
    scanf("%d", &n);
    for (int i = 0; i < n; i++) scanf("%d", a + i);
    for (int i = 1; i < n; i++)
        if ((a[i] == 3 && a[i - 1] == 2) || (a[i] == 2 && a[i - 1] == 3))
        {
            puts("Infinite");
            return 0;
        }
    puts("Finite");
    int ans = 0;
    for (int i = 1; i < n; i++)
    {
        if (a[i - 1] == 1 && a[i] == 2)
            ans += 3;
        if (a[i - 1] == 2 && a[i] == 1)
            ans += 3;
        if (a[i - 1] == 1 && a[i] == 3)
            ans += 4;
        if (a[i - 1] == 3 && a[i] == 1)
            ans += 4;
    }
    for (int i = 2; i < n; i++)
        if (a[i - 2] == 3 && a[i - 1] == 1 && a[i] == 2)
            ans--;
    printf("%d", ans);
    return 0;
}
