#include <bits/stdc++.h>
using namespace std;
long long sx[200005];
long long sy[200005];
long long tox, toy;
int n;
int di(int x) {
  long long l = x;
  long long r = n;
  long long tx, ty;
  tx = sx[x - 1];
  ty = sy[x - 1];
  if (abs(tox - tx) + abs(toy - ty) > n - x + 1) return -1;
  while (l < r) {
    long long m = l + r >> 1;
    tx = sx[x - 1] + sx[n] - sx[m];
    ty = sy[x - 1] + sy[n] - sy[m];
    if (abs(tox - tx) + abs(toy - ty) <= m - x + 1)
      r = m;
    else
      l = m + 1;
  }
  return l;
}
int main() {
  scanf("%d", &n);
  char c[200005];
  scanf("%s", c);
  scanf("%I64d%I64d", &tox, &toy);
  for (int i = 1; i <= n; ++i) {
    if (c[i - 1] == 'R') {
      sx[i] = sx[i - 1] + 1;
      sy[i] = sy[i - 1];
    } else if (c[i - 1] == 'L') {
      sx[i] = sx[i - 1] - 1;
      sy[i] = sy[i - 1];
    } else if (c[i - 1] == 'U') {
      sx[i] = sx[i - 1];
      sy[i] = sy[i - 1] + 1;
    } else {
      sx[i] = sx[i - 1];
      sy[i] = sy[i - 1] - 1;
    }
  }
  if (sx[n] == tox && sy[n] == toy) {
    printf("0\n");
    return 0;
  }
  if (abs(abs(tox) + abs(toy) - n) % 2 == 1 || abs(tox) + abs(toy) - n > 0) {
    printf("-1\n");
    return 0;
  }
  int len = 0x3f3f3f3f;
  for (int i = 1; i <= n; ++i) {
    int ri = di(i);
    if (ri == -1) continue;
    len = min(len, ri - i + 1);
  }
  printf("%d\n", len);
  return 0;
}
