#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n;
string str;
struct Point {
  int x, y;
  Point() { x = y = 0; }
  Point(int a, int b) {
    x = a;
    y = b;
  }
  void doMove(char c) {
    switch (c) {
      case 'U':
        y++;
        break;
      case 'D':
        y--;
        break;
      case 'L':
        x--;
        break;
      case 'R':
        x++;
        break;
    }
  }
  friend ostream& operator<<(ostream& os, const Point& pt) {
    return os << "(" << pt.x << ", " << pt.y << ")\n";
  }
  friend bool operator==(Point u, Point v) {
    return (u.x == v.x) && (u.y == v.y);
  }
  friend Point operator-(Point u, Point v) {
    return Point(u.x - v.x, u.y - v.y);
  }
  friend Point operator+(Point u, Point v) {
    return Point(u.x + v.x, u.y + v.y);
  }
} des, pos[N];
void read() {
  cin >> n;
  cin >> str;
  cin >> des.x >> des.y;
}
void init() {
  pos[0] = Point(0, 0);
  for (int i = 1; i <= n; ++i) {
    pos[i] = pos[i - 1];
    pos[i].doMove(str[i - 1]);
  }
}
bool check(int len) {
  for (int i = 1; i <= n - len + 1; ++i) {
    int left = i, right = i + len - 1;
    Point dist = des - ((pos[n] - pos[right]) + pos[left - 1]);
    int matDist = abs(dist.x) + abs(dist.y);
    if (matDist <= len && ((len & 1) == (matDist & 1))) {
      return true;
    }
  }
  return false;
}
void solve() {
  init();
  if (des == pos[n]) {
    cout << 0;
  } else {
    int low = 1, high = n;
    while (low <= high) {
      int mid = (low + high) >> 1;
      if (check(mid))
        high = mid - 1;
      else
        low = mid + 1;
    }
    if (high == n)
      cout << -1;
    else
      cout << high + 1;
  }
}
int main() {
  read();
  solve();
  return 0;
}
