#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int x, y;
  cin >> x >> y;
  auto f = make_pair(0, 0);
  for (char c : s) {
    if (c == 'U') f.second++;
    if (c == 'D') f.second--;
    if (c == 'L') f.first--;
    if (c == 'R') f.first++;
  }
  auto tar = make_pair(x - f.first, y - f.second);
  int l = 0, r = n;
  int mid, ans = -1;
  while (l <= r) {
    mid = (l + r) / 2;
    int xx = 0, yy = 0;
    bool cs = false;
    for (int i = 0; i < mid; i++) {
      char c = s[i];
      if (c == 'U') yy++;
      if (c == 'D') yy--;
      if (c == 'L') xx--;
      if (c == 'R') xx++;
    }
    long long int here = abs(xx + tar.first) + abs(yy + tar.second);
    if (here <= mid && (mid - here) % 2 == 0) {
      cs = true;
    }
    for (int i = mid; i < n; i++) {
      char c = s[i];
      if (c == 'U') yy++;
      if (c == 'D') yy--;
      if (c == 'L') xx--;
      if (c == 'R') xx++;
      c = s[i - mid];
      if (c == 'U') yy--;
      if (c == 'D') yy++;
      if (c == 'L') xx++;
      if (c == 'R') xx--;
      here = abs(xx + tar.first) + abs(yy + tar.second);
      if (here <= mid && (mid - here) % 2 == 0) {
        cs = true;
        break;
      }
    }
    if (cs) {
      ans = mid;
      r = mid - 1;
    } else {
      l = mid + 1;
    }
  }
  cout << ans;
}
