#include <bits/stdc++.h>
using namespace std;
int n, x, y;
string str;
int leri[200010], leri1[200010], updo[200010], updo1[200010];
int check(int mid) {
  for (int i = 0; i <= n - mid; i++) {
    int j = i + mid - 1;
    int p = leri[n - 1] - leri[j];
    int p1 = updo[n - 1] - updo[j];
    if (i > 0) {
      p += leri[i - 1];
      p1 += updo[i - 1];
    }
    int diff = abs(x - p) + abs(y - p1);
    if (diff <= mid && ((mid - diff) % 2 == 0)) return 1;
  }
  return 0;
}
int main() {
  cin >> n;
  cin >> str;
  cin >> x >> y;
  memset(leri, 0, sizeof(leri1));
  memset(updo, 0, sizeof(updo1));
  if ((abs(x) + abs(y)) > n) {
    cout << "-1" << endl;
  } else {
    for (int i = 0, j = str.length() - 1; i < str.length(); i++, j--) {
      if (i == 0) {
        if (str[i] == 'L')
          leri[i] += -1;
        else if (str[i] == 'R')
          leri[i] += 1;
        else if (str[i] == 'U')
          updo[i] += 1;
        else if (str[i] == 'D')
          updo[i] += -1;
        if (str[j] == 'L')
          leri1[j] += -1;
        else if (str[j] == 'R')
          leri1[j] += 1;
        else if (str[j] == 'U')
          updo1[j] += 1;
        else if (str[j] == 'D')
          updo1[j] += -1;
      } else {
        leri[i] = leri[i - 1];
        updo[i] = updo[i - 1];
        leri1[j] = leri1[j + 1];
        updo1[j] = updo1[j + 1];
        if (str[i] == 'L')
          leri[i] += -1;
        else if (str[i] == 'R')
          leri[i] += 1;
        else if (str[i] == 'U')
          updo[i] += 1;
        else if (str[i] == 'D')
          updo[i] += -1;
        if (str[j] == 'L')
          leri1[j] += -1;
        else if (str[j] == 'R')
          leri1[j] += 1;
        else if (str[j] == 'U')
          updo1[j] += 1;
        else if (str[j] == 'D')
          updo1[j] += -1;
      }
    }
    if (leri[str.length() - 1] == x && updo[str.length() - 1] == y) {
      cout << 0 << endl;
    } else {
      int low = 1, high = n, ans = -1;
      while (low <= high) {
        int mid = (low + high) / 2;
        if (check(mid)) {
          ans = mid;
          high = mid - 1;
        } else {
          low = mid + 1;
        }
      }
      cout << ans << endl;
    }
  }
}
