#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int l = 0, r = 0, u = 0, d = 0;
  for (int i = (0); i <= (n - 1); i++) {
    if (s[i] == 'L') l++;
    if (s[i] == 'R') r++;
    if (s[i] == 'U') u++;
    if (s[i] == 'D') d++;
  }
  int t1 = max(l, r) - min(l, r);
  int t2 = max(u, d) - min(u, d);
  cout << n - t1 - t2 << endl;
  return 0;
}
