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