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