#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int inix = 0;
  int iniy = 0;
  int x = 0;
  int y = 0;
  int countU = 0;
  int countD = 0;
  int countL = 0;
  int countR = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'U') {
      countU++;
    }
    if (s[i] == 'D') {
      countD++;
    }
    if (s[i] == 'L') {
      countL++;
    }
    if (s[i] == 'R') {
      countR++;
    }
  }
  cout << min(countR, countL) * 2 + min(countD, countU) * 2 << endl;
  return 0;
}
