#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, f = 0, x = 0, u = 0, l = 0, d = 0, r = 0, i;
  char c[1000];
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> c[i];
    if (c[i] == 'U')
      u++;
    else if (c[i] == 'D')
      d++;
    else if (c[i] == 'L')
      l++;
    else if (c[i] == 'R')
      r++;
  }
  if (u == d) x += u + d;
  if (l == r) x += l + r;
  if (u != 0 && d != 0) {
    if (u > d)
      x += 2 * d;
    else if (d > u)
      x += 2 * u;
  }
  if (l != 0 && r != 0) {
    if (l > r)
      x += 2 * r;
    else if (r > l)
      x += 2 * l;
  }
  cout << x;
  return 0;
}
