human
Berland regional ICPC contest has just ended. There were m participants numbered from 1 to m, who competed on a problemset of n problems numbered from 1 to n.

Now the editorial is about to take place. There are two problem authors, each of them is going to tell the tutorial to exactly k consecutive tasks of the problemset. The authors choose the segment of k consecutive tasks for themselves independently of each other. The segments can coincide, intersect or not intersect at all.

The i-th participant is interested in listening to the tutorial of all consecutive tasks from l_i to r_i. Each participant always chooses to listen to only the problem author that tells the tutorials to the maximum number of tasks he is interested in. Let this maximum number be a_i. No participant can listen to both of the authors, even if their segments don't intersect.

The authors want to choose the segments of k consecutive tasks for themselves in such a way that the sum of a_i over all participants is maximized.

Input

The first line contains three integers n, m and k (1 ≤ n, m ≤ 2000, 1 ≤ k ≤ n) — the number of problems, the number of participants and the length of the segment of tasks each of the problem authors plans to tell the tutorial to.

The i-th of the next m lines contains two integers l_i and r_i (1 ≤ l_i ≤ r_i ≤ n) — the segment of tasks the i-th participant is interested in listening to the tutorial to.

Output

Print a single integer — the maximum sum of a_i over all participants.

Examples

Input

10 5 3
1 3
2 4
6 9
6 9
1 8

Output

14

Input

10 3 3
2 4
4 6
3 5

Output

8

Input

4 4 1
3 3
1 1
2 2
4 4

Output

2

Input

5 4 5
1 2
2 3
3 4
4 5

Output

8

Note

In the first example the first author can tell the tutorial to problems from 1 to 3 and the second one — from 6 to 8. That way the sequence of a_i will be [3, 2, 3, 3, 3]. Notice that the last participant can't listen to both author, he only chooses the one that tells the maximum number of problems he's interested in.

In the second example...
Solve the task in PYTHON3.
 Can you provide a Python code to print a single integer — the maximum sum of a_i over all participants?
assistant
#Here is Python code to print a single integer — the maximum sum of a_i over all participants.

import sys
import sys
import os
from io import BytesIO, IOBase

#Fast IO Region
BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

problem, contesttant, seg_len = map(int, input().split())
arr = []
for _ in range(contesttant):
    arr.append(list(map(int, input().split())))

arr.sort(key=sum)

suffix = [0] * (contesttant + 2)

for seg_start in range(1, problem+1):
    seg_end = seg_start + seg_len - 1
    if seg_end > problem:
        break
    
   ...