#include <bits/stdc++.h>
using namespace std;
long long max(int x, int y) { return x > y ? x : y; }
long long min(long long x, long long y) { return x > y ? y : x; }
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long sum(long long n) {
  if (n == 1) return 1;
  return (n * (n + 1)) / 2;
}
long long a[500005], b[500005], m[500005];
int main() {
  int n, i, l, r, u, d;
  cin >> n;
  string s;
  cin >> s;
  l = d = u = r = 0;
  for (i = 0; i < n; i++) {
    if (s[i] == 'L')
      l++;
    else if (s[i] == 'R')
      r++;
    else if (s[i] == 'U')
      u++;
    else if (s[i] == 'D')
      d++;
  }
  int ans = 0;
  if (l == r) {
    ans += (l + min(u, d));
  } else if (u == d) {
    ans += u;
    ans += min(l, r);
  } else {
    ans = min(l, r) + min(u, d);
  }
  cout << 2 * ans << endl;
  return 0;
}
