#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
const int mod = 1000000007;
char mov[256];
int dx[] = {1, 0, -1, 0};
int dy[] = {0, -1, 0, 1};
char s[200005];
int main() {
  mov['R'] = 0;
  mov['D'] = 1;
  mov['L'] = 2;
  mov['U'] = 3;
  int n;
  scanf("%d", &n);
  long long int first = 1, second = 1;
  for (int i = 0; i < n; i++) {
    string in;
    cin >> in;
    if (in == "ULDR") first++, second++;
    if (in == "UR" || in == "DL") first++;
    if (in == "UL" || in == "DR") second++;
  }
  printf("%lld\n", first * second);
}
