#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string str;
  cin >> str;
  int u = 0, l = 0, d = 0, r = 0;
  for (int i = 0; i < str.length(); i++) {
    if (str[i] == 'U')
      u++;
    else if (str[i] == 'D')
      d++;
    else if (str[i] == 'L')
      l++;
    else
      r++;
  }
  if ((u > 0 && d > 0) || (l > 0 && r > 0))
    cout << 2 * min(u, d) + 2 * min(l, r);
  else
    cout << 0;
  return 0;
}
