#include <bits/stdc++.h>
using namespace std;
const int MAX = 50;
int main() {
  long long int n{};
  scanf("%lld", &n);
  map<char, long long int> x;
  string s;
  cin.ignore();
  getline(cin, s);
  for (auto i : s) {
    if (x[i] == 0)
      x[i] = 1;
    else
      x[i]++;
  }
  long long int maxcommands = 2 * (min(x['L'], x['R']) + min(x['U'], x['D']));
  printf("%lld", maxcommands);
  return 0;
}
