#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long N = 2e5 + 7;
const int mod = 1e9 + 7;
bool cmp(const pair<long long, long long>& a,
         const pair<long long, long long>& b) {
  return a.first < b.first;
}
void solve() {
  int n, l, r, u, d;
  cin >> n;
  string s;
  cin >> s;
  l = count(s.begin(), s.end(), 'L');
  r = count(s.begin(), s.end(), 'R');
  u = count(s.begin(), s.end(), 'U');
  d = count(s.begin(), s.end(), 'D');
  cout << (2 * (min(l, r))) + (2 * (min(u, d)));
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
}
