#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
int n, x, y;
int nx[MAXN] = {0}, ny[MAXN] = {0};
char str[MAXN];
void input() {
  scanf("%d", &n);
  scanf("%s", str);
  scanf("%d%d", &x, &y);
}
bool check(int mid) {
  for (int l = 1, r = mid; r <= n; l++, r++) {
    int xx = nx[n] - (nx[r] - nx[l - 1]);
    int yy = ny[n] - (ny[r] - ny[l - 1]);
    int len = abs(x - xx) + abs(y - yy);
    if (mid >= len && (mid - len) % 2 == 0) return true;
  }
  return false;
}
int main() {
  input();
  for (int i = 0; i < n; i++) {
    nx[i + 1] = nx[i];
    ny[i + 1] = ny[i];
    if (str[i] == 'R')
      nx[i + 1]++;
    else if (str[i] == 'L')
      nx[i + 1]--;
    else if (str[i] == 'U')
      ny[i + 1]++;
    else if (str[i] == 'D')
      ny[i + 1]--;
  }
  int lef = 0, rig = n;
  int ans = 0x3f3f3f;
  while (lef <= rig) {
    int mid = (lef + rig) >> 1;
    if (check(mid))
      rig = mid - 1, ans = mid;
    else
      lef = mid + 1;
  }
  if (ans == 0x3f3f3f) ans = -1;
  cout << ans;
  return 0;
}
