#include <bits/stdc++.h>
using namespace std;
int a[4];
int main() {
  cin.tie(0);
  size_t n;
  cin >> n;
  string s;
  cin >> s;
  assert(s.length() == n);
  for (const char i : s) {
    switch (i) {
      case 'L':
        a[0]++;
        break;
      case 'R':
        a[1]++;
        break;
      case 'D':
        a[2]++;
        break;
      case 'U':
        a[3]++;
        break;
    }
  }
  cout << 2 * (min(a[0], a[1]) + min(a[2], a[3])) << '\n';
}
