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