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