Apartments#287

Apartments

1 second
128 megabytes
Easy (≈1000)

There are applicants and vacant apartments. Your task is to assign apartments to as many applicants as possible.

Each applicant has a desired apartment size, and they will accept any apartment that is close enough to their desired size.

Input

The first line contains three integers n, m~(1 \le n, m \le 2 \cdot 10^5) and k~(0 \le k \le 10^9) — the number of applicants, the number of apartments, and the maximum allowable difference.

The next line contains integers a_1, a_2, ..., a_n~(1 \le a_i, b_i \le 10^9) — the desired apartment size for each applicant. If an applicant's desired size is , they will accept any apartment with a size between x − k and x + k.

The last line contains integers b_1, b_2, ..., b_m — the size of each apartment.

Output

Print a single integer — the maximum number of applicants who can receive an apartment.

Examples

Example 1

Loading
Loading