#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, l, r, u, d;
  char x;
  cin >> n;
  l = r = u = d = 0;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    if (x == 'L') {
      l++;
    }
    if (x == 'U') {
      u++;
    }
    if (x == 'D') {
      d++;
    }
    if (x == 'R') {
      r++;
    }
  }
  cout << (min(u, d) * 2 + min(l, r) * 2);
  return 0;
}
