#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 5;
int arr[N];
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  map<char, int> mp;
  for (int i = 0; i < s.size(); i++) {
    mp[s[i]]++;
  }
  int ans = 0;
  ans += min(mp['L'], mp['R']) * 2;
  ans += min(mp['U'], mp['D']) * 2;
  cout << ans << endl;
  return 0;
}
