#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string cmd;
  cin >> n;
  cin >> cmd;
  int dx = 0, dy = 0;
  int res = 0;
  for (int i = 0; i < cmd.size(); i++) {
    if (cmd[i] == 'U')
      dy++;
    else if (cmd[i] == 'D')
      dy--;
    else if (cmd[i] == 'L')
      dx--;
    else if (cmd[i] == 'R')
      dx++;
  }
  cout << n - abs(dx) - abs(dy);
  return 0;
}
