#include <bits/stdc++.h>
using namespace std;
char a[110];
int main() {
  int n, u, d, l, r;
  u = d = l = r = 0;
  scanf("%d%s", &n, a);
  for (int i = 0; i < n; i++) {
    if (a[i] == 'U')
      u++;
    else if (a[i] == 'D')
      d++;
    else if (a[i] == 'L')
      l++;
    else
      r++;
  }
  printf("%d\n", min(u, d) * 2 + min(l, r) * 2);
}
