#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long int n, m, ans = 0, cnt = 0, p = 0, q = 0;
  string s;
  cin >> n;
  cin >> s;
  for (long long int i = 0; i < n; i++) {
    if (s[i] == 'L')
      p--;
    else if (s[i] == 'R')
      p++;
    else if (s[i] == 'D')
      q--;
    else
      q++;
  }
  if (p < 0 || q < 0)
    cout << n - (abs(p) + abs(q));
  else
    cout << n - (p + q);
}
