#include <bits/stdc++.h>
using namespace std;
int n;
char s[200005];
int main() {
  long long a = 0, b = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s);
    if (strlen(s) == 4) {
      a++;
      b++;
    } else if ((s[0] == 'U' && s[1] == 'R') || (s[0] == 'D' && s[1] == 'L'))
      a++;
    else if ((s[0] == 'U' && s[1] == 'L') || (s[0] == 'D' && s[1] == 'R'))
      b++;
  }
  printf("%I64d\n", (a + 1) * (b + 1));
}
