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