#include <bits/stdc++.h>
using namespace std;
void start() {}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, l = 0, u = 0, r = 0, d = 0;
  cin >> n;
  string s;
  cin >> s;
  for (long long i = 0; i < n; i++) {
    if (s[i] == 'U') u++;
    if (s[i] == 'L') l++;
    if (s[i] == 'R') r++;
    if (s[i] == 'D') d++;
  }
  cout << 2 * (min(l, r) + min(u, d));
}
