#include <bits/stdc++.h>
const int Mod = 1000000007;
using namespace std;
int main(void) {
  int i, j, n;
  long long res;
  int xu, xl, xr, xd, yu, yl, yr, yd;
  string s;
  while (scanf("%d", &n) != EOF) {
    res = 1;
    xu = yu = xl = yl = xr = yr = xd = yd = 0;
    for (i = 0; i < n; i++) {
      cin >> s;
      j = 0;
      if (s == "ULDR")
        yu++, yd--, xr++, xl--;
      else if (s == "UR")
        yu++, yl++, xr++, xd++;
      else if (s == "UL")
        yu++, yr++, xl--, xd--;
      else if (s == "DR")
        yd--, yl--, xr++, xu++;
      else if (s == "DL")
        yd--, yr--, xl--, xu--;
    }
    res = (long long)(xr - xd + 1) * (xd - xl + 1);
    printf("%I64d\n", res);
  }
  return 0;
}
