#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> s;
  int l = 0, r = 0, u = 0, d = 0;
  int len = int(s.size());
  for (int i = 0; i < len; ++i) {
    if (s[i] == 'L') l++;
    if (s[i] == 'R') r++;
    if (s[i] == 'U') u++;
    if (s[i] == 'D') d++;
  }
  cout << (min(l, r) + min(u, d)) * 2 << endl;
  return 0;
}
