#include <bits/stdc++.h>
int commands[4];
int main() {
  int n;
  char s[110];
  scanf("%d\n", &n);
  scanf("%s\n", s);
  memset(commands, 0, sizeof(commands));
  for (int i = 0; i < n; i++) {
    switch (s[i]) {
      case 'U':
        commands[0]++;
        break;
      case 'D':
        commands[1]++;
        break;
      case 'L':
        commands[2]++;
        break;
      case 'R':
        commands[3]++;
        break;
    }
  }
  int ans = 0;
  ans = ans + abs(commands[0] - commands[1]);
  ans = ans + abs(commands[2] - commands[3]);
  ans = commands[0] + commands[1] + commands[2] + commands[3] - ans;
  printf("%d\n", ans);
  return 0;
}
