#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <functional>

using namespace std;
 
#define mod 1000000007
#define FOR(x,to) for(int x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define long long long
inline int rei(){int x;cin>>x;return x;}
inline long rel(){long x;cin>>x;return x;}
inline string res(){string x;cin>>x;return x;}
//------------------------------------------------------- 
void Calc(){
	int N = rei();
	double PMX = -500000000;
	double MMX = -500000000;
	double ZMX = -500000000;
	double PmX = 500000000;
	double MmX = 500000000;
	double ZmX = 500000000;
	double PMY = -500000000;
	double MMY = -500000000;
	double ZMY = -500000000;
	double PmY = 500000000;
	double MmY = 500000000;
	double ZmY = 500000000;
	double ans = 1000000000000000000;
	for(int i=0;i<N;i++){
		double X = rei();
		double Y = rei();
		string S = res();
		if(S[0] == 'R'){
			PMX = max(PMX,X);
			PmX = min(PmX,X);
			ZMY = max(ZMY,Y);
			ZmY = min(ZmY,Y);
		}
		if(S[0] == 'L'){
			MMX = max(MMX,X);
			MmX = min(MmX,X);
			ZMY = max(ZMY,Y);
			ZmY = min(ZmY,Y);
		}
		if(S[0] == 'U'){
			PMY = max(PMY,Y);
			PmY = min(PmY,Y);
			ZMX = max(ZMX,X);
			ZmX = min(ZmX,X);
		}
		if(S[0] == 'D'){
			MMY = max(MMY,Y);
			MmY = min(MmY,Y);
			ZMX = max(ZMX,X);
			ZmX = min(ZmX,X);
		}
	}
	for(int i=0;i<3;i++){
		for(int j=0;j<3;j++){
			for(int k=0;k<3;k++){
				for(int l=0;l<3;l++){
					double MT = 200000000;
					double mT = 0;
					//(at+b)(ct+d)
					long a = 0;
					long b = 0;
					long c = 0;
					long d = 0;
					if(i == 0){
						mT = max(mT,ZMX-PMX);
						mT = max(mT,(MMX-PMX+1)/2);
						a++;
						b += PMX;
					}
					if(i == 1){
						mT = max(mT,MMX-ZMX);
						MT = min(MT,ZMX-PMX);
						b += ZMX;
					}
					if(i == 2){
						MT = min(MT,MMX-ZMX);
						MT = min(MT,(MMX-PMX)/2);
						a--;
						b += MMX;
					}
					if(j == 0){
						mT = max(mT,MmX-ZmX);
						mT = max(mT,(MmX-PmX+1)/2);
						a++;
						b -= MmX;
					}
					if(j == 1){
						mT = max(mT,ZmX-PmX);
						MT = min(MT,MmX-ZmX);
						b -= ZmX;
					}
					if(j == 2){
						MT = min(MT,ZmX-PmX);
						MT = min(MT,(MmX-PmX)/2);
						a--;
						b -= PmX;
					}
					if(k == 0){
						mT = max(mT,ZMY-PMY);
						mT = max(mT,(MMY-PMY+1)/2);
						c++;
						d += PMY;
					}
					if(k == 1){
						mT = max(mT,MMY-ZMY);
						MT = min(MT,ZMY-PMY);
						d += ZMY;
					}
					if(k == 2){
						MT = min(MT,MMY-ZMY);
						MT = min(MT,(MMY-PMY)/2);
						c--;
						d += MMY;
					}
					if(l == 0){
						mT = max(mT,MmY-ZmY);
						mT = max(mT,(MmY-PmY+1)/2);
						c++;
						d -= MmY;
					}
					if(l == 1){
						mT = max(mT,ZmY-PmY);
						MT = min(MT,MmY-ZmY);
						d -= ZmY;
					}
					if(l == 2){
						MT = min(MT,ZmY-PmY);
						MT = min(MT,(MmY-PmY)/2);
						c--;
						d -= PmY;
					}
					if(mT > MT){
						continue;
					}
					long two = a*c;
					long one = a*d+c*b;
					long zero = b*d;
					ans = min(ans,(double)(mT*mT*two+mT*one+zero));
					ans = min(ans,(double)(MT*MT*two+MT*one+zero));
					if(two > 0){
						double t = one;
						t /= (2*two);
						t = -t;
						if(mT <= t && t <= MT){
							ans = min(ans,t*t*two+t*one+zero);
						}
					}
				}
			}
		}
	}
	printf("%1.10lf\n",ans);
}
int main(int argc,char** argv){
	ios::sync_with_stdio(false), cin.tie(0);
	cout.tie(0); Calc(); return 0;
}

Measured memory_bytes: 256