#include <bits/stdc++.h>
using namespace std;
int n, x = 0, lft = 0, rit = 0, up = 0, dn = 0;
string s;
int main() {
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'L') lft++;
    if (s[i] == 'R') rit++;
    if (s[i] == 'U') up++;
    if (s[i] == 'D') dn++;
  }
  x += 2 * min(lft, rit) + 2 * min(up, dn);
  cout << x << endl;
  return 0;
}
