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