#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, j, n, a = 0, b = 0, c = 0, d = 0;
  string s;
  cin >> n >> s;
  for (i = 0; i < n; i++) {
    if (s[i] == 'L')
      a++;
    else if (s[i] == 'R')
      b++;
    else if (s[i] == 'U')
      c++;
    else if (s[i] == 'D')
      d++;
  }
  c = min(c, d), a = min(a, b);
  cout << (c + a) * 2 << endl;
}
