#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
int n;
char s[200005];
int ex, ey;
int x[200005], y[200005];
void prework() {
  scanf("%d", &n);
  scanf("%s", s + 1);
  scanf("%d %d", &ex, &ey);
  for (int i = 1; i <= n; i++) {
    if (s[i] == 'R') {
      x[i] = 1;
      y[i] = 0;
    } else if (s[i] == 'L') {
      x[i] = -1;
      y[i] = 0;
    } else if (s[i] == 'U') {
      x[i] = 0;
      y[i] = 1;
    } else if (s[i] == 'D') {
      x[i] = 0;
      y[i] = -1;
    }
  }
  for (int i = 1; i <= n; i++) {
    x[i] = x[i - 1] + x[i];
    y[i] = y[i - 1] + y[i];
  }
  return;
}
bool check(int len) {
  int sx = x[n], sy = y[n];
  for (int i = 1; i + len - 1 <= n; i++) {
    int tl = i, tr = i + len - 1;
    int movex = x[tr] - x[tl - 1];
    int movey = y[tr] - y[tl - 1];
    int nowx = sx - movex, nowy = sy - movey;
    int dis = abs(nowx - ex) + abs(nowy - ey);
    if (dis <= len &&
        ((dis & 1) && (len & 1) || ((dis % 2 == 0) && (len % 2 == 0))))
      return true;
  }
  return false;
}
void Mainwork() {
  int l = 0, r = n;
  int mid, ans;
  bool tag = false;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check(mid)) {
      ans = mid;
      r = mid - 1;
      tag = true;
    } else
      l = mid + 1;
  }
  if (tag)
    printf("%d\n", ans);
  else
    printf("-1\n");
  return;
}
int main() {
  prework();
  Mainwork();
  getchar();
  getchar();
  return 0;
}
