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