#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  long n, i, k = 0, u = 0, d = 0, l = 0, r = 0;
  cin >> n;
  cin >> s;
  for (i = 0; i < s.size(); i++) {
    if (s[i] == 'U') u++;
    if (s[i] == 'D') d++;
    if (s[i] == 'L') l++;
    if (s[i] == 'R') r++;
  }
  k += min(d, u) * 2;
  k += min(r, l) * 2;
  cout << k;
}
