#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e6 + 10, mod = 1e9 + 7, oo = INT_MAX;
int n;
string s;
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  int x = 0;
  int y = 0;
  cin >> s;
  int countl = 0;
  int countr = 0;
  int countu = 0;
  int countd = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'L') countl++;
    if (s[i] == 'R') countr++;
    if (s[i] == 'U') countu++;
    if (s[i] == 'D') countd++;
  }
  cout << 2 * min(countl, countr) + 2 * min(countu, countd) << "\n";
  return 0;
}
