#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long M = 1e5 + 7;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  int n, du = 0, dl = 0, dr = 0, dv = 0;
  string s;
  cin >> n >> s;
  for (int i = 0; i < s.size(); i++) {
    switch (s[i]) {
      case 'U':
        du++;
        break;
      case 'D':
        dv++;
        break;
      case 'L':
        dl++;
        break;
      case 'R':
        dr++;
    }
  }
  cout << min(du, dv) * 2 + min(dl, dr) * 2;
}
