#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  string s;
  cin >> s;
  int cu = 0, cd = 0, cl = 0, cr = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'U')
      cu++;
    else if (s[i] == 'D')
      cd++;
    else if (s[i] == 'L')
      cl++;
    else
      cr++;
  }
  printf("%d\n", 2 * min(cl, cr) + 2 * min(cd, cu));
  return 0;
}
