#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int dr[5];
  for (int i = 0; i < 5; i++) {
    dr[i] = 0;
  }
  for (int i = 0; i < n; i++) {
    char t;
    cin >> t;
    if (t == 'L') {
      dr[1] += 1;
    }
    if (t == 'R') {
      dr[2] += 1;
    }
    if (t == 'D') {
      dr[3] += 1;
    }
    if (t == 'U') {
      dr[4] += 1;
    }
  }
  n = n - abs(dr[1] - dr[2]) - abs(dr[3] - dr[4]);
  cout << n;
  return 0;
}
