#include<cstdio> #include<iostream> usingnamespacestd; constint N = 1600; int f[2 * N][2 * N], g[8 * N][4 * N];
intmain(){ int n; scanf("%d", &n); for (int i = 0; i < n; i++){ char s[10]; int x,y,d; scanf("%s%d%d%d",s, &x,&y,&d); d /= 2; if (s[0] == 'A') { f[x-d+N][y-d+N]++; f[x+d+N][y-d+N]--; f[x-d+N][y+d+N]--; f[x+d+N][y+d+N]++; } else { int x0 = x - y, y0 = x + y; x = x0, y = y0; g[2*x-2*d+4*N][y-d+2*N]++; g[2*x+2*d+4*N][y-d+2*N]--; g[2*x-2*d+4*N][y+d+2*N]--; g[2*x+2*d+4*N][y+d+2*N]++; } } for (int i = 0; i < 2 * N; i++) for (int j = 0; j < 2 * N; j++) { if (i > 0) f[i][j] += f[i-1][j]; if (j > 0) f[i][j] += f[i][j-1]; if (i > 0 && j > 0) f[i][j] -= f[i-1][j-1]; }
for (int i = 0; i < 8 * N; i++) for (int j = 0; j < 4 * N; j++) { if (i > 0) g[i][j] += g[i-1][j]; if (j > 0) g[i][j] += g[i][j-1]; if (i > 0 && j > 0) g[i][j] -= g[i-1][j-1]; } double ans = 0; for (int x = -1510; x < 1510; x++) for (int y = -1510; y < 1510; y++) { if (f[x+N][y+N]) ans++; else { int x0 = x - y, y0 = x + y; if (g[2*x0-1+4*N][y0+1+2*N]) ans += 0.25; if (g[2*x0-1+4*N][y0+2*N]) ans += 0.25; if (g[2*x0+4*N][y0+1+2*N]) ans += 0.25; if (g[2*x0+4*N][y0+2*N]) ans += 0.25; } } printf("%.2lf\n", ans); }