#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5, M = 1e9 + 7;
int n, m, k, x, y, xx, yy;
int fr[5], sum[N][5];
bool vis[N];
vector<char> v;
map<char, pair<int, int>> mp;
map<char, int> id;
bool check(int k) {
  for (int i = 1; i + k - 1 <= n; i++) {
    int a[5];
    for (int j = 1; j < 5; j++) {
      a[j] = sum[i + k - 1][j] - sum[i - 1][j];
      a[j] = sum[n][j] - a[j];
    }
    yy = a[1] - a[2];
    xx = a[4] - a[3];
    int t = abs(y - yy) + abs(x - xx);
    if ((k >= t) && !((k - t) & 1)) return 1;
  }
  return 0;
}
int main() {
  mp['U'] = make_pair(0, 1);
  mp['D'] = make_pair(0, -1);
  mp['L'] = make_pair(-1, 0);
  mp['R'] = make_pair(1, 0);
  id['U'] = 1;
  id['D'] = 2;
  id['L'] = 3;
  id['R'] = 4;
  scanf("%d", &n);
  v.resize(n);
  pair<int, int> S = make_pair(0, 0);
  for (int i = 0; i < n; i++) {
    scanf(" %c", &v[i]);
    S.first += mp[v[i]].first;
    S.second += mp[v[i]].second;
    for (int j = 1; j < 5; j++) sum[i + 1][j] = sum[i][j];
    sum[i + 1][id[v[i]]] = ++fr[id[v[i]]];
  }
  scanf("%d%d", &x, &y);
  if (abs(x) + abs(y) > n) {
    printf("-1");
    return 0;
  }
  if ((abs(x) + abs(y)) % 2 != (n % 2)) {
    printf("-1");
    return 0;
  }
  if (S.first == x && S.second == y) {
    printf("0");
    return 0;
  }
  int l = 0, r = n, md, k = n;
  while (l <= r) {
    md = (l + r) >> 1;
    if (check(md)) {
      r = md - 1;
      k = md;
    } else
      l = md + 1;
  }
  printf("%d", k);
  return 0;
}
