#include <bits/stdc++.h>
using namespace std;
const long long inf = LONG_MAX;
const long long arr = 100000;
long long n, ans, U, D, R, L, x, y;
long long a[arr];
bool comp(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first == b.first)
    return a.second < b.second;
  else
    return a.first < b.first;
}
int main(void) {
  cin >> n;
  string second;
  cin >> second;
  int i = 0;
  for (i = 0; i < (n); ++i) {
    if (second[i] == 'U') U++;
    if (second[i] == 'D') D++;
    if (second[i] == 'R') R++;
    if (second[i] == 'L') L++;
  }
  ans = min(U, D) * 2 + min(L, R) * 2;
  cout << ans << '\n';
  return 0;
}
