#include <bits/stdc++.h>
using namespace std;
int n;
string s;
map<char, int> cnt;
int ans;
int main() {
  cin >> n >> s;
  for (int i = 0; i < s.size(); ++i) ++cnt[s[i]];
  while (cnt['L']-- && cnt['R']--) ++ans;
  while (cnt['U']-- && cnt['D']--) ++ans;
  cout << ans * 2;
  return 0;
}
