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