#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int main() {
  int n, a = 0, b = 0, c = 0, d = 0;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'L')
      a++;
    else if (s[i] == 'R')
      b++;
    else if (s[i] == 'U')
      c++;
    else if (s[i] == 'D')
      d++;
  }
  cout << 2 * min(a, b) + 2 * min(c, d) << endl;
  return 0;
}
