#include<bits/stdc++.h>
#define REP(x,y,z) for(int x=y;x<=z;x++)
#define MSET(x,y) memset(x,y,sizeof(x))
#define M 100005
#define INF 2000000000
using namespace std;
int n,x[M],y[M];
char d[M];
vector<long double> tp;
vector<int> work_mn(int ar[],char minus,char add) {
    // a
    // b-t
    // c+t
    int a = INF;
    int b = INF;
    int c = INF;

    REP(i,1,n) {
        if(d[i]==minus) b = min(b, ar[i]);
        else if(d[i]==add) c = min(c, ar[i]);
        else a = min(a, ar[i]);
    }

    if (a!=INF && b!=INF && b-a>0)
        tp.push_back(b-a);
    if (a!=INF && c!=INF && a-c>0)
        tp.push_back(a-c);
    if (b!=INF && c!=INF && b-c>0)
        tp.push_back((b-c)/2.0);
    return {a,b,c};
}
vector<int> work_mx(int ar[],char minus,char add) {
    int a = -INF;
    int b = -INF;
    int c = -INF;

    REP(i,1,n) {
        if(d[i]==minus) b = max(b, ar[i]);
        else if(d[i]==add) c = max(c, ar[i]);
        else a = max(a, ar[i]);
    }

    if (a!=-INF && b!=-INF && b-a>0)
        tp.push_back(b-a);
    if (a!=-INF && c!=-INF && a-c>0)
        tp.push_back(a-c);
    if (b!=-INF && c!=-INF && b-c>0)
        tp.push_back((b-c)/2.0);
    return {a,b,c};
}
int main()
{
    vector<int> xmn, xmx, ymn, ymx;
    while (~scanf("%d", &n)) {
        tp.clear();
        char cmd[3];
        REP(i,1,n) {
            scanf("%d %d %s",&x[i],&y[i],cmd);
            d[i] = cmd[0];
        }

        xmn = work_mn(x, 'L', 'R');
        xmx = work_mx(x, 'L', 'R');
        ymn = work_mn(y, 'D', 'U');
        ymx = work_mx(y, 'D', 'U');
        auto get_mn = [&](vector<int> tmp, long double t) {
            long double tt[3] = {1e9, 1e9, 1e9};
            if (tmp[0]!=INF) tt[0] = tmp[0];
            if (tmp[1]!=INF) tt[1] = tmp[1]-t;
            if (tmp[2]!=INF) tt[2] = tmp[2]+t;
            if (tt[0]<=tt[1] && tt[0]<=tt[2]) return 0;
            if (tt[1]<=tt[2] && tt[1]<=tt[0]) return 1;
            return 2;
        };
        auto get_mx = [&](vector<int> tmp, long double t) {
            long double tt[3] = {-1e9, -1e9, -1e9};
            if (tmp[0]!=INF) tt[0] = tmp[0];
            if (tmp[1]!=INF) tt[1] = tmp[1]-t;
            if (tmp[2]!=INF) tt[2] = tmp[2]+t;
            if (tt[0]>=tt[1] && tt[0]>=tt[2]) return 0;
            if (tt[1]>=tt[2] && tt[1]>=tt[0]) return 1;
            return 2;
        };

        long double ans = 1e100;
        tp.push_back(0);
        tp.push_back(1000000000);
        sort(tp.begin(), tp.end());

        REP(i,1,(int)tp.size()-1) if (tp[i]-tp[i-1] > 1e-8) {
            long long a=0, b=0, c=0, dd=0;
            
            int tmp = get_mn(xmn, tp[i-1]+0.25);
            a -= xmn[tmp];
            if (tmp>=1) b -= (tmp==1?-1:1);

            tmp = get_mx(xmx, tp[i-1]+0.25);
            a += xmx[tmp];
            if (tmp>=1) b += (tmp==1?-1:1);

            tmp = get_mn(ymn, tp[i-1]+0.25);
            c -= ymn[tmp];
            if (tmp>=1) dd -= (tmp==1?-1:1);

            tmp = get_mx(ymx, tp[i-1]+0.25);
            c += ymx[tmp];
            if (tmp>=1) dd += (tmp==1?-1:1);

            long long a0 = b*dd;
            long long a1 = b*c + a*dd;
            long long a2 = a*c;
            ans = min(ans, a0*tp[i-1]*tp[i-1] + a1*tp[i-1] + a2);
            ans = min(ans, a0*tp[i]*tp[i] + a1*tp[i] + a2);
            if (a0!=0) {
                long double t3 = a1/a0/2.0;
                if (t3>=tp[i-1] && t3<=tp[i])
                    ans = min(ans, a0*t3*t3 + a1*t3 + a2);
            }
        }
        
        printf("%.10f\n", (double)ans);
    }
    return 0;
}


Measured memory_bytes: 1152