시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB39292374.194%

문제

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 $k$ 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 $n$, $m$ and $k$ ($1 \le n, m \le 250\,000$, $0 \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 $n$ space-separated integers $a_i$ ($1 \le a_i \le 1\,000\,000\,000$): the heights of girls, given in byteometers.

The third line of input contains a sequence of $m$ space-separated integers $b_i$ ($1 \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.

예제 입력 1

4 5 5
15 2 5 7
1 5 10 15 1

예제 출력 1

11

노트

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