#include <bits/stdc++.h>

//    #include <boost/multiprecision/cpp_int.hpp>
 #define int long long
 #define inf  1000000007
 #define pa pair<int,int>
 #define ll long long
 #define pal pair<double,double>
 #define ppap pair<pa,int>
  #define PI 3.14159265358979323846
  #define paa pair<int,char>
  #define  mp make_pair
  #define  pb push_back
  #define EPS (1e-10)
                                          
    int dx[8]={0,1,0,-1,1,1,-1,-1};
    int dy[8]={1,0,-1,0,-1,1,1,-1};
                                            using namespace std;
                                   			class pa3{
                                            	public:
                                            	int x;
                                   				int y,z;
                                            	pa3(int x=0,int y=0,int z=0):x(x),y(y),z(z) {}
                                            	bool operator < (const pa3 &p) const{
                                            		if(x!=p.x) return x<p.x;
                                            		if(y!=p.y) return y<p.y;
                                            		 return z<p.z;
                                            		//return x != p.x ? x<p.x: y<p.y;
                                            	}
                                   				bool operator > (const pa3 &p) const{
                                            		if(x!=p.x) return x>p.x;
                                            		if(y!=p.y) return y>p.y;
                                            		 return z>p.z;
                                            		//return x != p.x ? x<p.x: y<p.y;
                                            	}
                                            	bool operator == (const pa3 &p) const{
                                            		return x==p.x && y==p.y && z==p.z;
                                            	}
                                            		bool operator != (const pa3 &p) const{
                                            			return !( x==p.x && y==p.y && z==p.z);
                                            	}
                                            
                                            };
                                            
                                            class pa4{
                                            	public:
                                            	int x;
                                            	int y,z,w;
                                            	pa4(int x=0,int y=0,int z=0,int w=0):x(x),y(y),z(z),w(w) {}
                                            	bool operator < (const pa4 &p) const{
                                            		if(x!=p.x) return x<p.x;
                                            		if(y!=p.y) return y<p.y;
                                            		if(z!=p.z)return z<p.z;
                                            		return w<p.w;
                                            		//return x != p.x ? x<p.x: y<p.y;
                                            	}
                                            	bool operator > (const pa4 &p) const{
                                            		if(x!=p.x) return x>p.x;
                                            		if(y!=p.y) return y>p.y;
                                            		if(z!=p.z)return z>p.z;
                                            		return w>p.w;
                                            		//return x != p.x ? x<p.x: y<p.y;
                                            	}
                                            	bool operator == (const pa4 &p) const{
                                            		return x==p.x && y==p.y && z==p.z &&w==p.w;
                                            	}
                                            		
                                            
                                            };
                                            class pa2{
                                            	public:
                                            	int x,y;
                                            	pa2(int x=0,int y=0):x(x),y(y) {}
                                            	pa2 operator + (pa2 p) {return pa2(x+p.x,y+p.y);}
                                            	pa2 operator - (pa2 p) {return pa2(x-p.x,y-p.y);}
                                            	bool operator < (const pa2 &p) const{
                                            		return y != p.y ? y<p.y: x<p.x;
                                            	}
                                            	bool operator > (const pa2 &p) const{
                                            		return x != p.x ? x<p.x: y<p.y;
                                            	}
                                            	bool operator == (const pa2 &p) const{
                                            		return abs(x-p.x)==0 && abs(y-p.y)==0;
                                            	}
                                            	bool operator != (const pa2 &p) const{
                                            		return !(abs(x-p.x)==0 && abs(y-p.y)==0);
                                            	}
                                            		
                                            
                                            };
                                            

                      
                                string itos( int i ) {
                                ostringstream s ;
                                s << i ;
                                return s.str() ;
                                }
                                 
                                int gcd(int v,int b){
                                	if(v>b) return gcd(b,v);
                                	if(v==b) return b;
                                	if(b%v==0) return v;
                                	return gcd(v,b%v);
                                }
                 
                            
                                int mod;
int extgcd(int a, int b, int &x, int &y) {
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    int d = extgcd(b, a%b, y, x);
    y -= a/b * x;
    return d;
}
pa operator+(const pa & l,const pa & r) {   
    return {l.first+r.first,l.second+r.second};                                    
}    
pa operator-(const pa & l,const pa & r) {   
    return {l.first-r.first,l.second-r.second};                                    
}  
                                
                int pr[1200010];
                int inv[1200010];
                
                int beki(int wa,int rr,int warukazu){
                	if(rr==0) return 1%warukazu;
                	if(rr==1) return wa%warukazu;
                	wa%=warukazu;
                	if(rr%2==1) return ((ll)beki(wa,rr-1,warukazu)*(ll)wa)%warukazu;
                	ll zx=beki(wa,rr/2,warukazu);
                	return (zx*zx)%warukazu;
                }

                
    			int comb(int nn,int rr){
    				if(rr<0 || rr>nn || nn<0) return 0;
    				int r=pr[nn]*inv[rr];
    				r%=mod;
    				r*=inv[nn-rr];
    				r%=mod;
    				return r;
    			}
                
                void gya(int ert){
                	pr[0]=1;
                	for(int i=1;i<=ert;i++){
                		pr[i]=(pr[i-1]*i)%mod;
                	}
                		inv[ert]=beki(pr[ert],mod-2,mod);
                	for(int i=ert-1;i>=0;i--){
                		inv[i]=inv[i+1]*(i+1)%mod;
                	}
                }
                
              //   cin.tie(0);
    		//	ios::sync_with_stdio(false);
    			//priority_queue<pa3,vector<pa3>,greater<pa3>> pq;            
                 //sort(ve.begin(),ve.end(),greater<int>());
//    mt19937(clock_per_sec);
  //  mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()) ;
      
       
       
                               //----------------kokomade tenpure------------


int ma=inf*10000000ll;
int mi=inf*1000ll;
vector<pa4> yaru(vector<pa> ve){
	int n=ve.size();
	
	int po=-ma;
	int ne=-ma;
	int ze=-ma;
	for(auto v:ve){
		if(v.first<0)ne=max(ne,v.second);
		if(v.first==0)ze=max(ze,v.second);
		if(v.first>0)po=max(po,v.second);
	}
	int pz=ze-po;
	int nz=-ze+ne;
	int pn=(ne-po)/2;
//	cout<<pz<<" "<<nz<<" "<<pn<<endl;
	vector<pa4> ue;
	if(pz<=nz){
		ue.pb({-ma,pn,-1,ne});
			ue.pb({pn,ma,1,po});
	}
	else{
//		cout<<-ma<<" "<<nz<<" "<<pz<<" "<<ma<<endl;
		ue.pb({-ma,nz,-1,ne});
		ue.pb({nz,pz,0,ze});
		ue.pb({pz,ma,1,po});
		
	}

	po=ma;
	ne=ma;
	ze=ma;
	for(auto v:ve){
		if(v.first<0)ne=min(ne,v.second);
		if(v.first==0)ze=min(ze,v.second);
		if(v.first>0)po=min(po,v.second);
		//cout<<v.second<<endl;
	}
	
	 pz=ze-po;
	 nz=-ze+ne;
	 pn=(ne-po)/2;
	
	vector<pa4> si;

	if(nz<=pz){
		si.pb({-3*ma,pn,1,po});
			si.pb({pn,3*ma,-1,ne});
	}
	else{
		
		si.pb({-ma*3,pz,1,po});
		si.pb({pz,nz,0,ze});
		si.pb({nz,ma*3,-1,ne});
	}
	
	vector<int> haji;
	haji.pb(0);
	haji.pb(mi);
	
	for(auto v:ue){
		if(v.x>=0 && v.x<=mi) haji.pb(v.x);
		if(v.y>=0 && v.y<=mi) haji.pb(v.y);
	}
	
	for(auto v:si){
		if(v.x>=0 && v.x<=mi) haji.pb(v.x);
		if(v.y>=0 && v.y<=mi) haji.pb(v.y);
	}
	
	sort(haji.begin(),haji.end());
	haji.erase(unique(haji.begin(),haji.end()),haji.end());
	
	vector<pa4> ans;
	
	
	int er=haji.size();
	
	for(int i=0;i<er-1;i++){
		int l=haji[i];
		int r=haji[i+1];
//		cout<<l<<" "<<r<<endl;
		pa4 v1,v2;
		for(auto v:ue){
			if(v.x<= l && r<=v.y)v1=v;
		}
		
		for(auto v:si){
			if(v.x<= l && r<=v.y)v2=v;
		}
//		cout<<"s "<<v1.x<<" "<<v1.y<<" "<<v1.z<<" "<<v1.w<<endl;
//		cout<<v1.z<<" "<<v2.z<<endl;
		pa4 hoge=(pa4){l,r,v1.z-v2.z,v1.w-v2.w};
		
		ans.pb(hoge);
		
	}
	return ans;
	
}


 signed main(){
 	
 
    	       cin.tie(0);
   			ios::sync_with_stdio(false);
	int n;
 	cin>>n;
 	vector<pa> X,Y;
 	for(int i=0;i<n;i++){
 		
 		int x,y;
 		string s;
 		cin>>x>>y>>s;
 		x*=2;
 		y*=2;
 		if(s=="R"){
 				X.pb({1,x});
 				Y.pb({0,y});
 		}
 		
 		if(s=="L"){
 				X.pb({-1,x});
 				Y.pb({0,y});
 		}
 		
 		if(s=="U"){
 				X.pb({0,x});
 				Y.pb({1,y});
 		}
 		
 		if(s=="D"){
 				X.pb({0,x});
 				Y.pb({-1,y});
 		}
 	}
 	
 	
 	vector<pa4> XX=yaru(X);
 //	cout<<"===="<<endl;
 	vector<pa4> YY=yaru(Y);
 //	cout<<" ==== "<<endl;
 	for(auto v:XX){
 //	cout<<v.x<<" "<<v.y<<" "<<v.z<<" "<<v.w<<endl;
 	}
 	
 	double ans=1e60;
 	
 	
 	for(auto v:XX)for(auto w:YY){
 		int l=max(v.x,w.x);
 		int r=min(v.y,w.y);
 		if(l>r)continue;
 		double val;
 		if(v.z==0){
 			val=0.0+v.w*min(w.z*l+w.w,w.z*r+w.w);
 			ans=min(ans,val);
 			continue;
 			
 		}
 		if(w.z==0){
 			val=0.0+w.w*min(v.z*l+v.w,v.z*r+v.w);
 			ans=min(ans,val);
 			continue;
 			
 		}
 		if(v.z>0 && w.z>0){
 			val=0.0+(l*w.z+w.w)*(l*v.z+v.w);
 			ans=min(ans,val);
 			continue;
 		}
 		if(v.z<0 && w.z<0){
 			val=0.0+(r*w.z+w.w)*(r*v.z+v.w);
 			ans=min(ans,val);
 			continue;
 		}
 		
 		
 		double ji=(v.w*w.z+v.z*w.w+0.0)/2.0/(v.z*w.z*1.0);
 		
 		val=min(0.0+(l*w.z+w.w)*(l*v.z+v.w),0.0+(r*w.z+w.w)*(r*v.z+v.w));
 		
 		if(double(l)<=ji && ji<=double(r)){
 			val=min(val,0.0+(ji*w.z+w.w)*(ji*v.z+v.w));
 		}
 		ans=min(ans,val);
 		
 	}
	
 	printf("%.10lf\n",ans/4.0);
 	return 0;
 
  }
 

Measured memory_bytes: 5220