#include <bits/stdc++.h>
using namespace std;
inline int gcd(int x, int y) {
  int z;
  while (y) {
    z = x % y;
    x = y;
    y = z;
  }
  return x;
}
int a = 0, b = 0;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  int t = 0;
  for (int i = 1; i <= n; i++) {
    char s;
    cin >> s;
    if (s == 'R') a++;
    if (s == 'L') a--;
    if (s == 'U') b++;
    if (s == 'D') b--;
  }
  cout << n - (abs(a) + abs(b));
  return 0;
}
