#include <bits/stdc++.h>
using namespace std;
const int MAX = 1100;
int a[MAX], b, n, x, y, mx, u, r, d, l, ans;
string s;
int main() {
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'U') u++;
    if (s[i] == 'D') d++;
    if (s[i] == 'R') r++;
    if (s[i] == 'L') l++;
  }
  ans += 2 * min(u, d);
  ans += 2 * min(l, r);
  cout << ans << endl;
}
