#include <bits/stdc++.h>
using namespace std;
char a[101];
int main() {
  int n, UD = 0, LR = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 'U')
      UD++;
    else if (a[i] == 'D')
      UD--;
    else if (a[i] == 'L')
      LR--;
    else if (a[i] == 'R')
      LR++;
  }
  printf("%d", n - (abs(UD) + abs(LR)));
  return 0;
}
