QOJ.ac

QOJ

Time Limit: 3 s Memory Limit: 128 MB Total points: 100

#12298. Telescope

统计

Byteasar is going to watch a meteor shower tonight. He has read an exact prognosis of its route. He knows that the shower will be composed of n meteors and the i-th meteor will appear at $t_{i}$-th second after midnight, i.e., it will be visible between moments $t_{i} - 1$ and $t_{i}$. For each meteor, Byteasar is only interested in watching it the whole time it is visible.

Byteasar will watch the sky from a nearby hill. He is not going to do it with a naked eye. On the hill there is a telescope which perfectly suits an amateur's needs. However, it is not for free. The telescope accepts coins. For each c inserted bythalers it allows to watch the sky for exactly c seconds. Unfortunately the telescope is a bit shabby, so after an insertion of a coin one must wait for r seconds before anything is visible. Every time only a single coin is accepted. Thus, if you insert a c coin, the next coin will be accepted only after at least $r + c$ seconds.

Byteasar has m coins in his pocket with the values of $c_{1}, \ldots, c_{m}$ bythalers. He is going to use them to pay for the telescope. He wonders what is the maximum number of meteors he can observe with the telescope.

Input Format

The first line of the input contains three integers $n$, $m$ and $r$ ($1 ≤ n ≤ 100$, $1 ≤ m ≤ 10$, $1 ≤ r ≤ 10^{8}$). The second line is composed of $n$ integers $t_{1}, \ldots, t_{n}$ given in the increasing order ($1 ≤ t_{i} ≤ 10^{8}$). The third line contains m integers $c_{1},\ldots, c_{m}$ ($1 ≤ c_{i} ≤ 10^{8}$).

Output Format

The only line of the output should contain one integer, i.e., the maximum number of meteors that Byteasar can observe with the telescope.

Example

Input

7 3 2
1 3 6 7 8 12 13
2 5 1

Output

6

In the figure above black rectangles show seconds during which a meteor is visible. If Byteasar wants to see 6 meteors, he should insert his coins in moments -2, 2 and 9 in the following order of values: 1, 5 and 2 bythalers.

problem_12298_1.gif