#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  char arr[105];
  scanf("%d", &n);
  memset(arr, 0, sizeof(arr));
  scanf("%s", &arr);
  int U = 0, D = 0, R = 0, L = 0, ans = 0;
  for (int i = 0; i < n; i++) {
    if (arr[i] == 'U') {
      U++;
    }
    if (arr[i] == 'D') {
      D++;
    }
    if (arr[i] == 'R') {
      R++;
    }
    if (arr[i] == 'L') {
      L++;
    }
  }
  ans += 2 * min(U, D);
  ans += 2 * min(L, R);
  printf("%d", ans);
  return 0;
}
