#include <bits/stdc++.h>
using namespace std;
int main() {
  map<char, int> data;
  int n;
  cin >> n;
  char tmp;
  for (int i = 0; i < n; ++i) {
    cin >> tmp;
    ++data[tmp];
  }
  int result = min(data['L'], data['R']) + min(data['U'], data['D']);
  cout << result * 2 << endl;
  return 0;
}
