#include <bits/stdc++.h>
using namespace std;
long long n, m, x, y, z, w, t, k, u, ans = 1e15, dp[2][300100], a[300100];
bool che(long long l, long long r) {
  long long xx = dp[1][n] - dp[1][r] + dp[1][l - 1];
  long long yy = dp[0][n] - dp[0][r] + dp[0][l - 1];
  if (abs(xx - x) + abs(yy - y) <= r - l + 1 &&
      (abs(xx - x) + abs(yy - y) - (r - l + 1)) % 2 == 0)
    return true;
  return false;
}
string s;
int main() {
  cin >> n >> s >> x >> y;
  for (int i = 1; i <= n; i++) {
    dp[0][i] = dp[0][i - 1];
    dp[1][i] = dp[1][i - 1];
    if (s[i - 1] == 'U') dp[0][i]++;
    if (s[i - 1] == 'D') dp[0][i]--;
    if (s[i - 1] == 'L') dp[1][i]--;
    if (s[i - 1] == 'R') dp[1][i]++;
  }
  if (dp[1][n] == x && dp[0][n] == y) return cout << 0, 0;
  for (int i = 1; i <= n; i++) {
    long long bb = i - 1, ee = n, mid;
    while (ee - bb > 1) {
      mid = (ee + bb) / 2;
      if (che(i, mid))
        ee = mid;
      else
        bb = mid;
    }
    if (che(i, ee)) ans = min(ans, ee - i + 1);
  }
  if (ans == 1e15)
    cout << -1;
  else
    cout << ans;
  return 0;
}
