#include <bits/stdc++.h>
using namespace std;
int n;
string cmd;
int main() {
  cin >> n >> cmd;
  int res = 0;
  int l, r, u, d;
  l = r = u = d = 0;
  for (int i = 0; i < n; i++) {
    if (cmd[i] == 'U') u++;
    if (cmd[i] == 'D') d++;
    if (cmd[i] == 'L') l++;
    if (cmd[i] == 'R') r++;
  }
  res = min(l, r) + min(u, d);
  printf("%d\n", 2 * res);
  return 0;
}
