#include <bits/stdc++.h>
using namespace std;
char num[1005];
int main() {
  int len, a = 0, b = 0, c = 0, d = 0;
  scanf("%d", &len);
  scanf("%s", num);
  for (int i = 0; i < len; i++) {
    if (num[i] == 'L')
      a++;
    else if (num[i] == 'R')
      b++;
    else if (num[i] == 'D')
      c++;
    else
      d++;
  }
  printf("%d\n", min(a, b) * 2 + min(c, d) * 2);
  return 0;
}
