#include <bits/stdc++.h>
using namespace std;
char str[200010];
struct node {
  long x, y;
} buf[200010];
long l, r, mid;
long dis;
long x, y;
long n, ans = 99999;
bool check(int mid) {
  for (long i = 0; i <= n - mid; ++i) {
    long a = buf[i + mid].x - buf[i].x, b = buf[i + mid].y - buf[i].y;
    long temp_x = buf[n].x - a, temp_y = buf[n].y - b;
    long cut = mid, temp_dis = abs(x - temp_x) + abs(y - temp_y);
    if (cut - temp_dis >= 0 && cut % 2 == temp_dis % 2) {
      r = mid - 1;
      ans = min(ans, cut);
      return true;
    }
  }
  return false;
}
int main() {
  scanf("%ld", &n);
  scanf("%s", str);
  scanf("%ld%ld", &x, &y);
  dis = abs(x) + abs(y);
  if (dis > n || n % 2 != dis % 2) {
    printf("-1\n");
    return 0;
  }
  for (long i = 0; i < n; ++i) {
    switch (str[i]) {
      case 'U':
        buf[i + 1].y = buf[i].y + 1;
        buf[i + 1].x = buf[i].x;
        break;
      case 'D':
        buf[i + 1].y = buf[i].y - 1;
        buf[i + 1].x = buf[i].x;
        break;
      case 'L':
        buf[i + 1].x = buf[i].x - 1;
        buf[i + 1].y = buf[i].y;
        break;
      case 'R':
        buf[i + 1].x = buf[i].x + 1;
        buf[i + 1].y = buf[i].y;
        break;
    }
  }
  ans = n;
  l = 0;
  r = n - 1;
  mid = (n - 1) / 2;
  while (l <= r) {
    if (check(mid)) {
      r = mid - 1;
    } else {
      l = mid + 1;
    }
    mid = (l + r) / 2;
  }
  printf("%ld\n", ans);
  return 0;
}
