#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x = 0, y = 0, cont = 0, maxi = 0;
  char c;
  cin >> n;
  int com = n;
  while (n--) {
    cin >> c;
    if (c == 'L')
      x--;
    else if (c == 'R')
      x++;
    else if (c == 'U')
      y++;
    else if (c == 'D')
      y--;
  }
  maxi = abs(x) + abs(y);
  cout << com - maxi;
  return 0;
}
