#include <bits/stdc++.h>
const double pi = acos(-1.0), eps = 1e-9;
const int dx[8] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[8] = {0, 0, 1, -1, 1, -1, -1, 1};
const int MO = (int)(1e9 + 7);
using namespace std;
int c(string A) {
  if (A == "UL" || A == "DR") return 1;
  if (A == "UR" || A == "DL") return 2;
  return 3;
}
int main() {
  int n;
  cin >> n;
  long long ans = 1, A = 0, B = 0;
  for (int i = 1; i <= n; i++) {
    string t;
    cin >> t;
    int num = c(t);
    if (num == 1) ans = ans * 2 - (A * B) - A, ++A;
    if (num == 2) ans = ans * 2 - (A * B) - B, ++B;
    if (num == 3) ans = ans * 4 - (A * B * 3) - A * 2 - B * 2, ++A, ++B;
  }
  cout << ans << endl;
}
