#include <bits/stdc++.h>
using namespace std;
int a[1000];
int main() {
  int n, up = 0, down = 0, right = 0, left = 0;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < (int)s.size(); i++) {
    if (s[i] == 'L')
      left++;
    else if (s[i] == 'R')
      right++;
    else if (s[i] == 'U')
      up++;
    else
      down++;
  }
  cout << min(left, right) * 2 + min(up, down) * 2;
}
