#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int h = 0, v = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'U') v++;
    if (s[i] == 'D') v--;
    if (s[i] == 'R') h++;
    if (s[i] == 'L') h--;
  }
  cout << n - abs(v) - abs(h);
  return 0;
}
