#include <bits/stdc++.h>
using namespace std;
vector<char> a;
int x, y, n;
void update(pair<int, int> &pos, int i, int d) {
  if (a[i] == 'U')
    pos.second += d;
  else if (a[i] == 'D')
    pos.second -= d;
  else if (a[i] == 'R')
    pos.first += d;
  else
    pos.first -= d;
}
bool ok(pair<int, int> pos, int len) {
  int d = abs(x - pos.first) + abs(y - pos.second);
  if (d <= len && d % 2 == len % 2) return true;
  return false;
}
bool can(int len) {
  pair<int, int> pos = make_pair(0, 0);
  for (int i = len; i < a.size(); i++) update(pos, i, 1);
  int l = 0, r = len;
  while (1) {
    if (ok(pos, len)) return true;
    if (n == r) break;
    update(pos, l++, 1);
    update(pos, r++, -1);
  }
  return false;
}
int main() {
  cin >> n;
  cin.ignore();
  for (int i = 0; i < n; i++) {
    char temp;
    cin >> temp;
    a.push_back(temp);
  }
  cin >> x >> y;
  if (!ok(make_pair(0, 0), n))
    cout << -1 << endl;
  else {
    int l = -1, r = n;
    while (r - l > 1) {
      int len = (r + l) / 2;
      if (can(len))
        r = len;
      else
        l = len;
    }
    cout << r << endl;
  }
  return 0;
}
