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