#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  map<char, int> mp;
  for (auto i : s) {
    mp[i]++;
  }
  int r, l, u, d;
  r = mp['R'];
  l = mp['L'];
  u = mp['U'];
  d = mp['D'];
  long long ans = 0;
  ans = min(r, l) * 2;
  ans = ans + min(u, d) * 2;
  cout << ans << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long test = 1;
  for (int i = 0; i < test; i++) {
    solve();
  }
}
