#include <bits/stdc++.h>   using namespace std;   bool gt(long double a, long double b) { return a > b + 1e-12; }   long long a, b, x;   int main() {     int n;     cin >> n;     while (n--) {       string s;       cin >> s;       if (s ==  UR  || s ==  DL )         a++;       else if (s ==  UL  || s ==  DR )         b++;       else         x++;     }     cout << (x + 1 + a) * (x + 1 + b) << endl;     return 0;   }   