#include <bits/stdc++.h>
using namespace std;
mt19937 gen(time(nullptr));
const long long INF = 1e18;
long long n, x, y;
vector<pair<long long, long long> > pref, suff;
bool check(long long l, long long r) {
  long long x1 = (l == 0 ? 0 : pref[l - 1].first) +
                 (r == n - 1 ? 0 : suff[r + 1].first),
            y1 = (l == 0 ? 0 : pref[l - 1].second) +
                 (r == n - 1 ? 0 : suff[r + 1].second);
  long long a = abs(x - x1) + abs(y - y1);
  if (a > r - l + 1) return false;
  return ((r - l + 1 - a) % 2 == 0);
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> n >> s >> x >> y;
  pref.resize(n);
  suff.resize(n);
  map<char, pair<long long, long long> > m;
  m['R'] = {1, 0};
  m['L'] = {-1, 0};
  m['U'] = {0, 1};
  m['D'] = {0, -1};
  for (long long i = 0; i < n; i++) {
    pref[i] = {m[s[i]].first + (i != 0 ? pref[i - 1].first : 0),
               m[s[i]].second + (i != 0 ? pref[i - 1].second : 0)};
  }
  for (long long i = n - 1; i > -1; i--) {
    suff[i] = {m[s[i]].first + (i != n - 1 ? suff[i + 1].first : 0),
               m[s[i]].second + (i != n - 1 ? suff[i + 1].second : 0)};
  }
  long long ans = INF;
  if (pref[n - 1].first == x && pref[n - 1].second == y) {
    cout << 0;
    return 0;
  }
  for (long long i = 0; i < n; i++) {
    long long l = i - 1, r = n - 1;
    while (r - l > 1) {
      long long mid = (l + r) / 2;
      if (check(i, mid))
        r = mid;
      else
        l = mid;
    }
    if (check(i, r)) ans = min(ans, r - i + 1);
  }
  if (ans == INF)
    cout << -1;
  else
    cout << ans;
  return 0;
}
