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