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