#include <bits/stdc++.h>
using namespace std;
long long int bigMod(long long int A, long long int P, int M) {
  long long int R = 1;
  for (A %= M; P; P >>= 1) {
    if (P & 1) R = (R * A) % M;
    A = (A * A) % M;
  }
  return R;
}
long long int bigMul(long long int A, long long int B, long long int M) {
  long long int R = 0;
  for (A %= M; B; B >>= 1) {
    if (B & 1) R = (R + A) % M;
    A = (A + A) % M;
  }
  return R;
}
long long int negMod(long long int A, long long int B) {
  return (((A % B) + B) % B);
}
long long int invMod(long long int A, long long int M) {
  return bigMod(A, M - 2, M);
}
unsigned long long int _pow(unsigned long long int A, int P) {
  unsigned long long int R = 1;
  for (; P; P >>= 1) {
    if (P & 1) R = (R * A);
    A = (A * A);
  }
  return R;
}
template <class T>
T GCD(T x, T y) {
  while (x) x ^= y ^= x ^= y %= x;
  return y;
}
template <class T>
T LCM(T x, T y) {
  return (x / GCD(x, y)) * y;
}
inline long long CUL() {
  long long sign = 1, num;
  register char c;
  c = getchar();
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') sign = -1;
  for (num = 0; (c >= '0' && c <= '9');) {
    num = num * 10 + c - '0';
    c = getchar();
  }
  return num * sign;
}
inline int cul() {
  int n;
  scanf("%d", &n);
  return n;
}
struct pairs {
  int n;
  int m;
  bool operator<(const pairs& num) const { return n > num.n; }
};
int alp[27];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  string str;
  cin >> str;
  for (int i = 0; i < n; i++) {
    alp[str[i] - 'A']++;
  }
  int ans = 0;
  if (alp['R' - 'A'] > alp['L' - 'A'])
    ans += alp['L' - 'A'];
  else
    ans += alp['R' - 'A'];
  if (alp['D' - 'A'] > alp['U' - 'A'])
    ans += alp['U' - 'A'];
  else
    ans += alp['D' - 'A'];
  cout << ans * 2 << endl;
  return 0;
}
