#include <bits/stdc++.h>
using namespace std;
int n, x, y;
int X, Y;
string str;
int solve(int x1, int y1, int x2, int y2, int k) {
  int d1 = ((x1 - x2) < 0 ? -(x1 - x2) : (x1 - x2));
  int d2 = ((y1 - y2) < 0 ? -(y1 - y2) : (y1 - y2));
  if (d1 + d2 > k) return 0;
  int d = d1 + d2;
  int dif = ((k - d) < 0 ? -(k - d) : (k - d));
  return dif % 2 == 0;
}
int check(int k) {
  int tempX = X, tempY = Y;
  for (int i = 0; i < k - 1; i++) {
    if (str[i] == 'U')
      tempY--;
    else if (str[i] == 'D')
      tempY++;
    else if (str[i] == 'L')
      tempX++;
    else
      tempX--;
  }
  for (int i = k - 1; i < n; i++) {
    if (str[i] == 'U')
      tempY--;
    else if (str[i] == 'D')
      tempY++;
    else if (str[i] == 'L')
      tempX++;
    else
      tempX--;
    if (solve(tempX, tempY, x, y, k)) return 1;
    if (str[i - (k - 1)] == 'U')
      tempY++;
    else if (str[i - (k - 1)] == 'D')
      tempY--;
    else if (str[i - (k - 1)] == 'L')
      tempX--;
    else
      tempX++;
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  cin >> n;
  cin >> str;
  for (int i = 0; i < str.size(); i++) {
    if (str[i] == 'U')
      Y++;
    else if (str[i] == 'D')
      Y--;
    else if (str[i] == 'L')
      X--;
    else
      X++;
  }
  cin >> x >> y;
  if (X == x and Y == y) {
    cout << 0 << "\n";
    return 0;
  }
  int lo = 1, hi = n, mid, ans = -1;
  while (lo <= hi) {
    mid = (lo + hi) / 2;
    if (check(mid)) {
      ans = mid;
      hi = mid - 1;
    } else {
      lo = mid + 1;
    }
  }
  cout << ans << "\n";
}
