#include <bits/stdc++.h>
using namespace std;
int main() {
  int tst, x = 0, y = 0;
  string c;
  cin >> tst;
  char tmp;
  cin >> c;
  for (int i = 0; i < c.size(); i++) {
    if (c[i] == 'U')
      y++;
    else if (c[i] == 'D')
      y--;
    else if (c[i] == 'L')
      x--;
    else
      x++;
  }
  cout << tst - (abs(y) + abs(x)) << endl;
  return 0;
}
