#include <bits/stdc++.h>
using namespace std;
const long long oo = 1e13;
const long long M = 1e9;
int n, x, y, px[200010], py[200010];
string s;
int main() {
  cin >> n >> s >> x >> y;
  for (int i = 0; i < n; ++i) {
    if (s[i] == 'U')
      py[i]++;
    else if (s[i] == 'D')
      py[i]--;
    else if (s[i] == 'R')
      px[i]++;
    else
      px[i]--;
    if (i) {
      px[i] += px[i - 1];
      py[i] += py[i - 1];
    }
  }
  int ans = 1e9;
  px[-1] = 0;
  py[-1] = 0;
  int curx = px[n - 1], cury = py[n - 1];
  if (curx == x && cury == y) ans = 0;
  for (int i = 0; i < n; ++i) {
    int lo = i, hi = n - 1, md;
    while (lo <= hi) {
      md = (lo + hi) / 2;
      int cx = curx - (px[md] - px[i - 1]), cy = cury - (py[md] - py[i - 1]);
      int re = abs(x - cx) + abs(y - cy);
      int r1 = md - i + 1;
      bool ican = false;
      if (r1 >= re && (r1 - re) % 2 == 0) ican = true;
      if (ican) {
        hi = md - 1;
        ans = min(md - i + 1, ans);
      } else {
        lo = md + 1;
      }
    }
  }
  if (ans == 1e9) ans = -1;
  cout << ans << endl;
}
