#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m, i, j, k, ans = 0, sum = 0, mx = 0, mi = 2e18, a[100005] = {0},
                           x, y, z;
  string s;
  cin >> n;
  cin >> s;
  int l = 0, r = 0, d = 0, u = 0;
  for (i = 0; i < s.size(); i++) {
    if (s[i] == 'L') {
      l++;
    } else if (s[i] == 'R') {
      r++;
    } else if (s[i] == 'D') {
      d++;
    } else {
      u++;
    }
  }
  ans = 2 * min(u, d) + 2 * min(l, r);
  cout << ans;
  return 0;
}
