#include <bits/stdc++.h>
using namespace std;
char s[10];
int v[10];
int n;
int atualiza() {
  if (strlen(s) == 4) return 4;
  if (s[0] == 'U') {
    if (s[1] == 'L') return 0;
    return 1;
  }
  if (s[1] == 'L') return 2;
  return 3;
}
int main() {
  cin >> n;
  memset(v, 0, sizeof v);
  for (int i = 0; i < n; i++) {
    scanf(" %s", s);
    v[atualiza()]++;
  }
  int lim = v[0] + v[1] + v[4];
  long long ans = 0;
  int R_MAX, L_MAX;
  for (int x = 1; x < lim + 1; x++) {
    if (v[0] >= x) {
      int y = min(v[0] - x, v[2]);
      R_MAX = (n - x - 2 * y) - 2 * (v[0] - x - y) - 2 * (v[2] - y);
    } else
      R_MAX = n - x - 2 * v[2];
    if (v[1] >= x) {
      int y = min(v[1] - x, v[3]);
      L_MAX = (n - x - 2 * y) - 2 * (v[1] - x - y) - 2 * (v[3] - y);
    } else
      L_MAX = n - x - 2 * v[3];
    ans += (R_MAX + L_MAX) / 2 + 1;
  }
  lim = v[2] + v[3] + v[4];
  for (int x = 0; x < lim + 1; x++) {
    if (v[2] >= x) {
      int y = min(v[2] - x, v[0]);
      R_MAX = (n - x - 2 * y) - 2 * (v[2] - x - y) - 2 * (v[0] - y);
    } else
      R_MAX = n - x - 2 * v[0];
    if (v[3] >= x) {
      int y = min(v[3] - x, v[1]);
      L_MAX = (n - x - 2 * y) - 2 * (v[3] - x - y) - 2 * (v[1] - y);
    } else
      L_MAX = n - x - 2 * v[1];
    ans += (R_MAX + L_MAX) / 2 + 1;
  }
  cout << ans << endl;
  return 0;
}
