#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n;
  cin >> n;
  string s;
  cin >> s;
  int left = 0;
  int up = 0;
  int right = 0, down = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'L') {
      left++;
    } else if (s[i] == 'R') {
      right++;
    } else if (s[i] == 'U') {
      up++;
    } else {
      down++;
    }
  }
  int ans = min(left, right) * 2 + min(up, down) * 2;
  cout << ans << endl;
  return 0;
}
