#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int x, y, n, sx[maxn], sy[maxn], tep;
char s[maxn];
int main() {
  scanf("%d %s", &n, s + 1);
  scanf("%d %d", &x, &y);
  for (int i = 1; i <= n; i++) {
    sx[i] = sx[i - 1];
    sy[i] = sy[i - 1];
    if (s[i] == 'R') sx[i]++;
    if (s[i] == 'L') sx[i]--;
    if (s[i] == 'U') sy[i]++;
    if (s[i] == 'D') sy[i]--;
  }
  if (sx[n] == x && sy[n] == y)
    printf("0\n");
  else if (n < abs(x) + abs(y))
    printf("-1\n");
  else if ((n + abs(x) + abs(y)) % 2)
    printf("-1\n");
  else {
    int i = 1, j = 1, ans = maxn;
    while (1) {
      while (1) {
        if (j <= n)
          tep = abs(x - sx[n] + (sx[j] - sx[i - 1])) +
                abs(y - sy[n] + (sy[j] - sy[i - 1]));
        if ((tep <= j - i + 1) && (tep + j - i) & 1) break;
        j++;
      }
      if (j > n || i > n) break;
      ans = min(j - i + 1, ans);
      i++;
    }
    printf("%d\n", ans);
  }
}
