#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
using pii = pair<int, int>;
using vi = vector<int>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vlli = vector<long long int>;
using vpii = vector<pair<int, int>>;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans = 0;
  int u, d, l, r;
  u = d = l = r = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'L')
      l++;
    else if (s[i] == 'D')
      d++;
    else if (s[i] == 'U')
      u++;
    else
      r++;
  }
  cout << 2 * min(l, r) + 2 * min(u, d);
  return 0;
}
