#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, q1 = 0, q2 = 0, q3 = 0, q4 = 0;
  cin >> n;
  char tmp;
  for (int i = 0; i < n; ++i) {
    cin >> tmp;
    if (tmp == 'U')
      q1++;
    else if (tmp == 'D')
      q2++;
    else if (tmp == 'R')
      q3++;
    else if (tmp == 'L')
      q4++;
  }
  cout << 2 * (min(q1, q2) + min(q3, q4));
  return 0;
}
