#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, j, cc = 0, ans = 0;
  cin >> n;
  string str;
  cin >> str;
  long long l = 0, r = 0, u = 0, d = 0;
  for (i = 0; i < n; i++) {
    if (str[i] == 'L')
      l++;
    else if (str[i] == 'R')
      r++;
    else if (str[i] == 'U')
      u++;
    else if (str[i] == 'D')
      d++;
  }
  long long x = min(u, d);
  long long y = min(l, r);
  ans = x * 2 + y * 2;
  cout << ans << endl;
  return 0;
}
