#include <bits/stdc++.h>
using namespace std;
const int con = 1e6 + 6;
static const int INF = 0x3f3f3f3f;
int main() {
  int n;
  scanf("%d", &n);
  string s;
  cin >> s;
  int l = 0, r = 0, u = 0, d = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'U')
      u++;
    else if (s[i] == 'D')
      d++;
    else if (s[i] == 'R')
      r++;
    else
      l++;
  }
  int ans = min(l, r) + min(u, d);
  cout << ans * 2;
  return 0;
}
