#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k = 0, u = 0, d = 0, l = 0, r = 0;
  cin >> n;
  string a;
  cin >> a;
  for (int i = 0; i < n; i++) {
    if (a[i] == 'U') {
      u++;
    }
    if (a[i] == 'D') {
      d++;
    }
    if (a[i] == 'L') {
      l++;
    }
    if (a[i] == 'R') {
      r++;
    }
  }
  int sum1 = 0, sum2 = 0;
  if (u == d) {
    sum1 = u + d;
  } else {
    if (u > d) {
      sum1 = d * 2;
    } else
      sum1 = u * 2;
  }
  if (l == r) {
    sum2 = l + r;
  } else {
    if (l > r) {
      sum2 = r * 2;
    } else
      sum2 = l * 2;
  }
  cout << sum1 + sum2;
  return 0;
}
