#include <bits/stdc++.h>
using namespace std;
int solve() {
  int n, r = 0, l = 0, u = 0, d = 0;
  cin >> n;
  char a;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a == 'R') {
      r++;
    }
    if (a == 'L') {
      l++;
    }
    if (a == 'U') {
      u++;
    }
    if (a == 'D') {
      d++;
    }
  }
  cout << 2 * min(r, l) + 2 * min(d, u);
  return 0;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
