#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d\n", &n);
  char cmd;
  int cu = 0, cd = 0, cr = 0, cl = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%c", &cmd);
    switch (cmd) {
      case 'L':
        cl++;
        break;
      case 'R':
        cr++;
        break;
      case 'U':
        cu++;
        break;
      case 'D':
        cd++;
        break;
      default:
        break;
    }
  }
  printf("%d", 2 * min(cl, cr) + 2 * min(cu, cd));
  return 0;
}
