#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int n, x[maxn], y[maxn], q, w;
char a[maxn];
bool isok(int len) {
  for (int i = 1; i + len - 1 <= n; i++) {
    int j = i + len - 1;
    int sx = x[n] - (x[j] - x[i - 1]), sy = y[n] - (y[j] - y[i - 1]);
    sx = abs(sx - q), sy = abs(sy - w);
    if (sx + sy <= len && (len - sx - sy) % 2 == 0) return true;
  }
  return false;
}
int main() {
  cin >> n >> (a + 1) >> q >> w;
  for (int i = 1; i <= n; i++) {
    x[i] = x[i - 1], y[i] = y[i - 1];
    if (a[i] == 'R')
      x[i]++;
    else if (a[i] == 'L')
      x[i]--;
    else if (a[i] == 'U')
      y[i]++;
    else
      y[i]--;
  }
  int l = 0, r = n, ans = -1;
  while (r >= l) {
    int mid = l + r >> 1;
    if (isok(mid))
      ans = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  cout << ans;
}
