Olya wants to buy a custom wardrobe. It should have n boxes with heights a1, a2, ..., an, stacked one on another in some order. In other words, we can represent each box as a vertical segment of length ai, and all these segments should form a single segment from 0 to <image> without any overlaps.

Some of the boxes are important (in this case bi = 1), others are not (then bi = 0). Olya defines the convenience of the wardrobe as the number of important boxes such that their bottom edge is located between the heights l and r, inclusive.

You are given information about heights of the boxes and their importance. Compute the maximum possible convenience of the wardrobe if you can reorder the boxes arbitrarily.

Input

The first line contains three integers n, l and r (1 ≤ n ≤ 10 000, 0 ≤ l ≤ r ≤ 10 000) — the number of boxes, the lowest and the highest heights for a bottom edge of an important box to be counted in convenience.

The second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 10 000) — the heights of the boxes. It is guaranteed that the sum of height of all boxes (i. e. the height of the wardrobe) does not exceed 10 000: Olya is not very tall and will not be able to reach any higher.

The second line contains n integers b1, b2, ..., bn (0 ≤ bi ≤ 1), where bi equals 1 if the i-th box is important, and 0 otherwise.

Output

Print a single integer — the maximum possible convenience of the wardrobe.

Examples

Input

5 3 6
3 2 5 1 2
1 1 0 1 0


Output

2


Input

2 2 5
3 6
1 1


Output

1

Note

In the first example you can, for example, first put an unimportant box of height 2, then put an important boxes of sizes 1, 3 and 2, in this order, and then the remaining unimportant boxes. The convenience is equal to 2, because the bottom edges of important boxes of sizes 3 and 2 fall into the range [3, 6].

In the second example you have to put the short box under the tall box.
#include <bits/stdc++.h>
template <class T>
void rd(T &k) {
  int f = 1;
  char c = getchar();
  k = 0;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') k = k * 10 + c - '0', c = getchar();
  k *= f;
}
using namespace std;
const int N = 10005;
int n, m, k, s, t, l, r, f[N], sum;
struct node {
  int h, ty;
  bool operator<(const node &k) const {
    if (ty != k.ty) return (ty ? 0 : 1);
    return h > k.h;
  }
} a[N];
int main() {
  rd(n);
  rd(l);
  rd(r);
  for (register int i = 1; i <= n; ++i) rd(a[i].h), sum += a[i].h;
  for (register int i = 1; i <= n; ++i) rd(a[i].ty);
  s = sum - r;
  t = sum - l;
  l = s;
  r = t;
  sort(a + 1, a + 1 + n);
  memset(f, -0x3f, sizeof(f));
  f[0] = 0;
  sum = 0;
  for (register int i = 1; i <= n; ++i) {
    for (register int j = sum; j >= 0; --j)
      f[j + a[i].h] = max(f[j + a[i].h], f[j] + (j + a[i].h >= l &&
                                                 j + a[i].h <= r && a[i].ty));
    sum += a[i].h;
  }
  int ans = 0;
  for (register int i = 0; i <= sum; ++i) ans = max(ans, f[i]);
  cout << ans;
}
