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