#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, l = 0, r = 0, d = 0, u = 0, x, y;
  string str;
  cin >> n >> str;
  for (int i = 0; i < str.size(); i++) {
    if (str[i] == 'L')
      l++;
    else if (str[i] == 'R')
      r++;
    else if (str[i] == 'D')
      d++;
    else if (str[i] == 'U')
      u++;
  }
  x = min(l, r);
  y = min(u, d);
  l = l - x;
  r = r - x;
  u = u - y;
  d = d - y;
  cout << n - (l + r + u + d) << endl;
}
