#include <bits/stdc++.h>
using namespace std;
int read() {
  char ch = getchar();
  int x = 0, y = 1;
  while (!isdigit(ch) && ch != '-') ch = getchar();
  if (ch == '-') {
    y = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return x * y;
}
const int N = 2e5 + 5;
int x, y;
char s[N];
pair<int, int> sum1[N], sum2[N];
map<char, pair<int, int> > m;
int n;
bool check(int len) {
  for (int i = 1; i + len - 1 <= n; ++i) {
    int j = i + len - 1;
    pair<int, int> tmp;
    tmp.first = sum1[i - 1].first + sum2[j + 1].first;
    tmp.second = sum1[i - 1].second + sum2[j + 1].second;
    int xx = tmp.first;
    int yy = tmp.second;
    long long ans = abs(x - xx) + abs(y - yy);
    if (!(ans % 2 == 0 && len % 2 == 0 || ans % 2 != 0 && len % 2 != 0))
      continue;
    if (ans <= len) return true;
  }
  return false;
}
bool judge(int a, int b) {
  if (a % 2 == 0 && b % 2 == 0 || a % 2 != 0 && b % 2 != 0) return false;
  return true;
}
int main() {
  m['R'] = make_pair(1, 0);
  m['U'] = make_pair(0, 1);
  m['L'] = make_pair(-1, 0);
  m['D'] = make_pair(0, -1);
  cin >> n;
  scanf("%s", s + 1);
  cin >> x >> y;
  if (abs(x) + abs(y) > n || judge(n, abs(x) + abs(y))) {
    cout << -1 << endl;
    return 0;
  }
  for (int i = 1; i <= n; ++i) {
    sum1[i].first = sum1[i - 1].first + m[s[i]].first;
    sum1[i].second = sum1[i - 1].second + m[s[i]].second;
  }
  for (int i = n; i >= 1; --i) {
    sum2[i].first = sum2[i + 1].first + m[s[i]].first;
    sum2[i].second = sum2[i + 1].second + m[s[i]].second;
  }
  int l = 0, r = n + 1, ans = 0;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (check(mid)) {
      r = mid - 1;
      ans = mid;
    } else
      l = mid + 1;
  }
  cout << ans << "\n";
  return 0;
}
