#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int x = 0, y = 0;
  char dir[n];
  for (int i = 0; i < n; i++) {
    cin >> dir[i];
    if (dir[i] == 'L') x--;
    if (dir[i] == 'R') x++;
    if (dir[i] == 'U') y++;
    if (dir[i] == 'D') y--;
  }
  if (x < 0) x = -x;
  if (y < 0) y = -y;
  cout << n - x - y;
}
