#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <map>
using namespace std;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int sx = -2000000001;
    int fx = 2000000001;
    int sy = -2000000001;
    int fy = 2000000001;
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        int x, y;
        cin >> x >> y;
        char a;
        cin >> a;
        if (a == 'L' || a == 'R') {
            if(a=='R')sx = max(sx, x);
            else fx = min(fx, x);
        }
        else {
            if (a == 'U')sy = max(sy, y);
            else fy = min(fy, y);
        }
    } 
    int d = 2000000001;
    
    
    if ((fx - sx - 1) == 0 || (fy - sy - 1) == 0) {
        cout << 0;
        return 0;
    }
    if (abs(sx) == d || abs(sy) == d || abs(fx) == d || abs(fy) ==d){
        cout << "Infinity";
        return 0;
    }
    unsigned long long a = (fx - sx - 1) * (fy - sy - 1);
    cout << a;
    return 0;
}