#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t = 1;
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  while (t--) {
    long long int i, j, n, r = 0, l = 0, u = 0, d = 0;
    cin >> n;
    string s;
    cin >> s;
    for (i = 0; i < n; i++) {
      if (s[i] == 'R') r++;
      if (s[i] == 'L') l++;
      if (s[i] == 'U') u++;
      if (s[i] == 'D') d++;
    }
    r = min(r, l);
    u = min(u, d);
    cout << 2 * (r + u);
  }
  return 0;
}
