#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ;
  int n;
  cin >> n;
  string s;
  cin >> s;
  int d = 0, u = 0, l = 0, r = 0;
  for (int i = 0; i < (n); i++) {
    if (s[i] == 'L')
      l++;
    else if (s[i] == 'R')
      r++;
    else if (s[i] == 'D')
      d++;
    else
      u++;
  }
  long long int ma = 0;
  ma = 2 * min(u, d) + 2 * min(l, r);
  cout << ma;
  return 0;
}
