#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int main() {
  cin >> n;
  cin >> s;
  vector<int> a(255);
  for (auto c : s) {
    a[c]++;
  }
  cout << 2 * min(a['L'], a['R']) + 2 * min(a['U'], a['D']) << endl;
}
