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