#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int freq[4] = {0};
  string temp;
  int answer = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'L') {
      freq[0]++;
    } else if (s[i] == 'R') {
      freq[1]++;
    } else if (s[i] == 'U') {
      freq[2]++;
    } else if (s[i] == 'D') {
      freq[3]++;
    }
  }
  int ud = min(freq[2], freq[3]) * 2;
  int lr = min(freq[0], freq[1]) * 2;
  cout << ud + lr;
}
