#include <bits/stdc++.h>
using namespace std;
int c[500];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    char ch;
    cin >> ch;
    c[ch]++;
  }
  cout << 2 * (min(c['U'], c['D']) + min(c['R'], c['L']));
  return 0;
}
