#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const long long LINF = (long long)INF * INF;
int mnY(int cnt1, int cnt2, int cnt3, int x) {
  if (x >= 0) return -cnt3 + x;
  return mnY(cnt2, cnt1, cnt3, -x);
}
int mxY(int cnt1, int cnt2, int cnt3, int x) {
  if (x >= 0) {
    int a = min(cnt1, x);
    x -= a;
    cnt1 -= a;
    int b = min(cnt3, x);
    cnt3 -= b;
    x -= b;
    return a + 2 * min(cnt1, cnt2) + cnt3;
  }
  return mxY(cnt2, cnt1, cnt3, -x);
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  int cnt1 = 0, cnt2 = 0, cnt3 = 0;
  for (int i = (0); i < (n); ++i) {
    string s;
    cin >> s;
    if (s == "UL" || s == "DR")
      cnt1++;
    else if (s == "UR" || s == "DL")
      cnt2++;
    else
      cnt3++;
  }
  long long ans = 0;
  for (int x = (-n); x < (n + 1); ++x) {
    if ((x < 0 && cnt2 + cnt3 < -x) || (x > 0 && cnt1 + cnt3 < x)) continue;
    ans += (mxY(cnt1, cnt2, cnt3, x) - mnY(cnt1, cnt2, cnt3, x)) / 2 + 1;
  }
  cout << ans << "\n";
  return 0;
}
