#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  string s;
  long long int t = 0, uno = 0, dos = 0;
  for (int i = 0; i < n; i++) {
    cin >> s;
    t += s == "ULDR";
    uno += s == "UR" or s == "DL";
    dos += s == "UL" or s == "DR";
  }
  cout << (t + uno + 1) * (t + dos + 1) << endl;
}
