#include <bits/stdc++.h>
using namespace std;
long long n;
string s;
long long x, y;
long long nx, ny;
long long prex[212345];
long long prey[212345];
void move(char ch) {
  if (ch == 'U') {
    ny++;
  }
  if (ch == 'D') {
    ny--;
  }
  if (ch == 'R') {
    nx++;
  }
  if (ch == 'L') {
    nx--;
  }
}
void rmove(char ch) {
  if (ch == 'U') {
    ny--;
  }
  if (ch == 'D') {
    ny++;
  }
  if (ch == 'R') {
    nx--;
  }
  if (ch == 'L') {
    nx++;
  }
}
bool check(long long mid) {
  nx = prex[n] - prex[mid];
  ny = prey[n] - prey[mid];
  long long dif = abs(nx - x) + abs(ny - y);
  if (mid >= dif) return 1;
  for (long long i = 0; i < n - mid; i++) {
    move(s[i]);
    rmove(s[i + mid]);
    dif = dif = abs(nx - x) + abs(ny - y);
    if (mid >= dif) return 1;
  }
  return 0;
}
signed main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  cin >> s;
  cin >> x >> y;
  nx = 0, ny = 0;
  for (long long i = 0; i < n; i++) {
    move(s[i]);
    prex[i + 1] = nx;
    prey[i + 1] = ny;
  }
  if (n < abs(x) + abs(y)) {
    cout << -1 << '\n';
    return 0;
  }
  long long dif = abs(nx - x) + abs(ny - y);
  long long tot = abs(x) + abs(y);
  if (abs(tot - n) % 2 == 1) {
    cout << -1 << '\n';
    return 0;
  }
  long long l = 0, r = n + 1;
  while (l + 1 < r) {
    long long mid = l + (r - l) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  if (check(l))
    cout << l << '\n';
  else
    cout << r << '\n';
  return 0;
}
