#include <bits/stdc++.h>
using namespace std;
const int MXN = 1e6 + 10;
int a[MXN], b[MXN], p[MXN], n, sx, sy, x, y, ans = ~0u >> 1, X[MXN], Y[MXN];
char str[MXN];
bool check(int m) {
  for (int i = m; i <= n; ++i) {
    int tx = abs(X[i - m] - (sx - (X[n] - X[i])));
    int ty = abs(Y[i - m] - (sy - (Y[n] - Y[i])));
    int tt = tx + ty;
    if ((tt - m) % 2 == 0 && tt <= m) {
      return 1;
    }
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  cin >> str + 1;
  cin >> sx >> sy;
  for (int i = 1; i <= n; ++i) {
    if (str[i] == 'U') y++;
    if (str[i] == 'D') y--;
    if (str[i] == 'L') x--;
    if (str[i] == 'R') x++;
    X[i] = x, Y[i] = y;
  }
  int l = -1, r = n + 1;
  while (r - l > 1) {
    int m = (l + r) >> 1;
    if (check(m))
      r = m;
    else
      l = m;
  }
  if (r > n) {
    puts("-1");
  } else {
    printf("%d\n", r);
  }
  return 0;
}
