#include <bits/stdc++.h>
using namespace std;
int n, ans, x, y;
string s;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  cin >> s;
  for (int i = 0; i < n; ++i) {
    if (s[i] == 'U')
      ++y;
    else if (s[i] == 'D')
      --y;
    else if (s[i] == 'R')
      ++x;
    else
      --x;
  }
  ans = n - abs(x) - abs(y);
  cout << ans << endl;
  return 0;
}
