#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, l = 0, d = 0, u = 0, r = 0;
  string str;
  cin >> n;
  cin >> str;
  for (char ch : str) {
    if (ch == 'L')
      l++;
    else if (ch == 'R')
      r++;
    else if (ch == 'U')
      u++;
    else if (ch == 'D')
      d++;
  }
  cout << 2 * min(l, r) + 2 * min(u, d) << endl;
  return 0;
}
