#include <bits/stdc++.h>
char str[10000];
int main() {
  int n, i, j, k, l, d, u, r, m, x = 0, y = 0, L;
  l = 0;
  d = 0;
  r = 0;
  u = 0;
  scanf("%d%s", &n, str);
  L = strlen(str);
  for (i = 0; i < L; i++) {
    if (str[i] == 'U')
      y++;
    else if (str[i] == 'D')
      y--;
    else if (str[i] == 'L')
      x--;
    else if (str[i] == 'R')
      x++;
  }
  if (x < 0) x *= -1;
  if (y < 0) y *= -1;
  int count = n - x - y;
  printf("%d\n", count);
  return 0;
}
