#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char s;
  int a = 0, b = 0, c = 0, d = 0, i, j, k;
  for (i = 0; i < n; i++) {
    cin >> s;
    if (s == 'L') {
      a++;
    } else if (s == 'U') {
      b++;
    } else if (s == 'R') {
      c++;
    } else {
      d++;
    }
  }
  int e, f;
  e = min(a, c);
  f = min(b, d);
  cout << 2 * (e + f) << endl;
}
