#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int x[maxn], y[maxn];
bool check(int n, int len, int targex, int targey) {
  for (int i = 1; i <= n - len + 1; i++) {
    int nowx = x[n] + x[i - 1] - x[i + len - 1];
    int nowy = y[n] + y[i - 1] - y[i + len - 1];
    int dis = abs(nowx - targex) + abs(nowy - targey);
    if (len >= dis && (len - dis) % 2 == 0) return true;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  char c;
  cin >> c;
  if (c == 'U')
    y[1] = 1;
  else if (c == 'D')
    y[1] = -1;
  else if (c == 'L')
    x[1] = -1;
  else if (c == 'R')
    x[1] = 1;
  for (int i = 2; i <= n; i++) {
    cin >> c;
    if (c == 'U')
      x[i] = x[i - 1], y[i] = y[i - 1] + 1;
    else if (c == 'D')
      x[i] = x[i - 1], y[i] = y[i - 1] - 1;
    else if (c == 'L')
      x[i] = x[i - 1] - 1, y[i] = y[i - 1];
    else if (c == 'R')
      x[i] = x[i - 1] + 1, y[i] = y[i - 1];
  }
  int tx1, ty1;
  cin >> tx1 >> ty1;
  int l = 0, r = n;
  int ans = -1;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (check(n, mid, tx1, ty1)) {
      r = mid - 1;
      ans = mid;
    } else
      l = mid + 1;
  }
  cout << ans;
}
