Prom

아직 제출이 없습니다시간 제한1초메모리 제한128 MB

문제

Johnny is getting ready for prom, which traditionally begins with a polonnaise dance. Any mixed pair (boy and girl) can lead the polonnaise, as long as they do not differ too much in height. More precisely, the difference in their heights cannot exceed kk byteometers. Jimmy wants to find out how many ways there are to choose the leading pair.

Write a program which reads the heights of all girls and boys, computes the number of possible leading pairs, and writes the result to standard output.

입력

The first line of input contains three space-separated integers nn, mm and kk (1n,m250,0001 \le n, m \le 250\\,000, 0k1,000,000,0000 \le k \le 1 \\,000\\,000\\,000), denoting the number of girls, the number of boys and the maximum possible difference of height in the leading pair, respectively.

The second line of input contains a sequence of nn space-separated integers a_ia\_i (1a_i1,000,000,0001 \le a\_i \le 1\\,000\\,000\\,000): the heights of girls, given in byteometers.

The third line of input contains a sequence of mm space-separated integers b_ib\_i (1b_i1,000,000,0001 \le b\_i \le 1\\,000\\,000\\,000): the heights of boys, given in byteometers.

출력

The first and only line of output should contain a single integer --- the number of possible leading pairs.

힌트

There are 1111 possible leading pairs: (15,10)(15,10), (15,15)(15,15), (1,1)(1,1), (1,5)(1,5), (1,1)(1,1), (5,1)(5,1), (5,5)(5,5), (5,10)(5,10), (5,1)(5,1), (7,5)(7,5) and (7,10)(7,10).