#include <bits/stdc++.h>
int main() {
  int len, i, l = 0, r = 0, u = 0, d = 0, dif1, dif2;
  scanf("%d", &len);
  char str[101];
  scanf(" %s", str);
  for (i = 0; i < len; i++) {
    if (str[i] == 'L')
      l++;
    else if (str[i] == 'R')
      r++;
    else if (str[i] == 'U')
      u++;
    else if (str[i] == 'D')
      d++;
  }
  dif1 = l - r;
  if (dif1 < 0) dif1 = -dif1;
  dif2 = u - d;
  if (dif2 < 0) dif2 = -dif2;
  printf("%d\n", (len - (dif1 + dif2)));
  return 0;
}
