#include <bits/stdc++.h>
using namespace std;
int n, p[10];
char a[10];
int main() {
  cin >> n;
  memset(p, 0, sizeof(p));
  for (int i = 0; i < n; i++) {
    scanf("%s", &a);
    if (a[0] == 'U') {
      if (a[1] == 'R')
        p[2]++;
      else if (a[2] == 'D')
        p[5]++;
      else
        p[1]++;
    } else {
      if (a[1] == 'L')
        p[3]++;
      else
        p[4]++;
    }
  }
  long long t1, t2;
  t1 = p[1] + p[4] + 1 + p[5];
  t2 = p[2] + p[3] + 1 + p[5];
  t1 = t1 * t2;
  cout << t1 << endl;
  return 0;
}
