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