#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200000 + 5;
int n, ex, ey;
char s[MAXN];
struct node {
  int x, y;
  node() {}
  node(int _x, int _y) : x(_x), y(_y) {}
} p[MAXN];
bool OK(int t) {
  for (int i = 0; i + t <= n; i++) {
    int px = p[i].x - p[0].x + p[n].x - p[i + t].x;
    int py = p[i].y - p[0].y + p[n].y - p[i + t].y;
    int tx = ex - px;
    int ty = ey - py;
    if (abs(tx) + abs(ty) <= t) {
      return true;
    }
  }
  return false;
}
int main() {
  while (~scanf("%d", &n)) {
    scanf("%s", s + 1);
    scanf("%d%d", &ex, &ey);
    if ((n - abs(ex) - abs(ey)) < 0) {
      printf("-1\n");
      continue;
    }
    if ((n - abs(ex) - abs(ey)) & 1) {
      printf("-1\n");
      continue;
    }
    p[0] = node(0, 0);
    for (int i = 1; i <= n; i++) {
      if (s[i] == 'U') {
        p[i] = node(p[i - 1].x, p[i - 1].y + 1);
      } else if (s[i] == 'D') {
        p[i] = node(p[i - 1].x, p[i - 1].y - 1);
      } else if (s[i] == 'L') {
        p[i] = node(p[i - 1].x - 1, p[i - 1].y);
      } else if (s[i] == 'R') {
        p[i] = node(p[i - 1].x + 1, p[i - 1].y);
      }
    }
    int l = 0, r = n;
    while (l <= r) {
      int mid = (l + r) >> 1;
      if (OK(mid)) {
        r = mid - 1;
      } else {
        l = mid + 1;
      }
    }
    printf("%d\n", r + 1);
  }
  return 0;
}
