#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  long long int r, i;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
long long int power(long long int x, long long int y, long long int mod) {
  long long int temp, ty, my;
  if (y == 0) return 1;
  temp = power(x, y / 2, mod);
  ty = (temp % mod) * (temp % mod);
  if (y % 2 == 0) {
    return ty % mod;
  } else {
    my = (x % mod) * (ty % mod);
    return my % mod;
  }
}
long long int mycbrt(long long int n) {
  long long int start = 0;
  long long int end = 1000000LL;
  long long int ans = -1;
  while (start <= end) {
    long long int mid = (start + end) / 2;
    if ((mid * mid * mid) > n)
      end = mid - 1;
    else if ((mid * mid * mid) == n) {
      ans = mid;
      break;
    } else {
      start = mid + 1;
    }
  }
  if (n == 1) {
    ans = 1;
  }
  return ans;
}
void SieveOfEratosthenes(int n) {
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * 2; i <= n; i += p) prime[i] = false;
    }
  }
  for (int p = 2; p <= n; p++)
    if (prime[p]) cout << p << " ";
}
struct abhi {
  long long int val1;
  long long int val2;
  long long int po;
};
bool cmp(struct abhi x, struct abhi y) {
  if (x.val1 == y.val1) return x.val2 < y.val2;
  return x.val1 < y.val1;
}
void fastscan(int &number) {
  bool negative = false;
  register int c;
  number = 0;
  c = getchar();
  if (c == '-') {
    negative = true;
    c = getchar();
  }
  for (; (c > 47 && c < 58); c = getchar()) number = number * 10 + c - 48;
  if (negative) number *= -1;
}
vector<pair<long long int, long long int> > po;
long long int vis[2010];
long long int dpu[200010];
long long int dpd[200010];
long long int dpr[200010];
long long int dpl[200010];
long long int ar[2000010];
long long int br[2000010];
vector<long long int> graph[1000];
vector<pair<long long int, long long int> > vec2;
map<long long int, pair<long long int, long long int> > mp;
string str;
long long int vertical(long long int index, long long int tempy,
                       long long int fg) {
  if (fg == 0) {
    if (str[index] == 'U') {
      tempy++;
    } else if (str[index] == 'D') {
      tempy--;
    }
    return tempy;
  } else {
    if (str[index] == 'U') {
      tempy--;
    } else if (str[index] == 'D') {
      tempy++;
    }
    return tempy;
  }
}
long long int horizontal(long long int index, long long int tempx,
                         long long int fg) {
  if (fg == 0) {
    if (str[index] == 'R') {
      tempx++;
    } else if (str[index] == 'L') {
      tempx--;
    }
    return tempx;
  } else {
    if (str[index] == 'R') {
      tempx--;
    } else if (str[index] == 'L') {
      tempx++;
    }
    return tempx;
  }
}
long long int checkValid(long long int diff, long long int mid) {
  if (mid % 2 == diff % 2 && mid >= diff) {
    return 1;
  }
  return 0;
}
long long int solve(long long int mid, long long int n, long long int x,
                    long long int y) {
  long long int i, j, k;
  long long int tempx = 0, tempy = 0;
  for (i = (mid); i < (n); i++) {
    tempx = horizontal(i, tempx, 0);
    tempy = vertical(i, tempy, 0);
  }
  long long int diff = abs(tempx - x) + abs(tempy - y);
  long long int po = checkValid(diff, mid);
  if (po == 1) {
    return 1;
  }
  long long int st = 0;
  for (i = (mid); i < (n); i++) {
    tempx = horizontal(mid + st, tempx, -1);
    tempy = vertical(mid + st, tempy, -1);
    tempx = horizontal(st, tempx, 0);
    tempy = vertical(st, tempy, 0);
    diff = abs(tempx - x) + abs(tempy - y);
    po = checkValid(diff, mid);
    st++;
    if (po == 1) {
      return 1;
    }
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int i, j, k, n, x, y;
  cin >> n;
  cin >> str;
  cin >> x >> y;
  long long int lef, rig;
  lef = 0;
  rig = n;
  long long int diff = abs(x) + abs(y);
  if (diff % 2 != n % 2 || diff > n) {
    cout << "-1\n";
    return 0;
  }
  while (lef <= rig) {
    long long int mid = (lef + rig) / 2;
    long long int ch = solve(mid, n, x, y);
    if (ch == 1) {
      rig = mid - 1;
    } else {
      lef = mid + 1;
    }
  }
  cout << lef << "\n";
  return 0;
}
