#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int x = 0, y = 0;
  int ans = 0;
  string s;
  cin >> s;
  for (auto& c : s) {
    switch (c) {
      case ('U'):
        y++;
        break;
      case ('D'):
        y--;
        break;
      case ('L'):
        x--;
        break;
      case ('R'):
        x++;
        break;
    }
  }
  ans = s.size() - abs(x) - abs(y);
  cout << ans;
}
