#include <bits/stdc++.h>
using namespace std;
int n, x, y;
string s, f;
pair<int, int> a[200020], b[200020];
bool ok(int t) {
  for (int i = t; i <= n; i++) {
    int dis =
        abs(b[i].first - a[i - t].first) + abs(b[i].second - a[i - t].second);
    if (dis <= t && (t - dis) % 2 == 0) return 1;
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  cin >> n;
  cin >> s;
  cin >> x >> y;
  f = s;
  for (int i = 0; i <= n - 1; i++) {
    if (f[i] == 'L')
      f[i] = 'R';
    else if (f[i] == 'R')
      f[i] = 'L';
    else if (f[i] == 'U')
      f[i] = 'D';
    else if (f[i] == 'D')
      f[i] = 'U';
  }
  int u = 0, v = 0;
  for (int i = 0; i <= n - 1; i++) {
    if (s[i] == 'L') a[i + 1].first = --u, a[i + 1].second = v;
    if (s[i] == 'R') a[i + 1].first = ++u, a[i + 1].second = v;
    if (s[i] == 'U') a[i + 1].first = u, a[i + 1].second = ++v;
    if (s[i] == 'D') a[i + 1].first = u, a[i + 1].second = --v;
  }
  u = x, v = y;
  b[n].first = x;
  b[n].second = y;
  for (int i = n - 1; i >= 0; i--) {
    if (f[i] == 'L') b[i].first = --u, b[i].second = v;
    if (f[i] == 'R') b[i].first = ++u, b[i].second = v;
    if (f[i] == 'U') b[i].first = u, b[i].second = ++v;
    if (f[i] == 'D') b[i].first = u, b[i].second = --v;
  }
  int l = 0, r = n + 1, mid, ans = -1;
  while (l < r) {
    mid = (l + r) / 2;
    if (ok(mid))
      r = mid, ans = mid;
    else
      l = mid + 1;
  }
  cout << ans;
  return 0;
}
