#include <bits/stdc++.h>
using namespace std;
const int N = 1001;
int i, j, n, a[N], m;
int main() {
  scanf("%d", &n);
  getchar();
  for (i = 1; i <= n; i++) {
    char ch = getchar();
    if (ch == 'U') a[0]++;
    if (ch == 'D') a[1]++;
    if (ch == 'L') a[2]++;
    if (ch == 'R') a[3]++;
  }
  printf("%d\n", 2 * min(a[0], a[1]) + 2 * min(a[2], a[3]));
}
