Skyscrapers#10031

Skyscrapers

1 second
128 megabytes
Medium

years later, when the coronavirus epidemic was stopped, skyscrapers are planned to be built in Baku. We will represent Baku as the coordinate axis of numbers. For each skyscraper, its coordinate (x_i) and height (h_i) are given. Engineers consider the skyscraper unprofitable if to the left of it at a distance of no more than , and also to the right of it at a distance of no more than , there is a skyscraper whose height is at least twice that of the given skyscraper (this skyscraper itself may be unprofitable). Such skyscrapers are considered unsuccessful from a business point of view, so engineers plan to build some other facility instead. You must calculate the number of unprofitable skyscrapers so that engineers can make appropriate decisions.

Input

The first line contains two numbers (1 \leq n \leq 10^5) and (1 \leq d \leq 10^9). The next lines contain integers x_i and h_i (1 \leq x_i, h_i \leq 10^9). All coordinates of skyscrapers are different.

Output

Print the number of unprofitable skyscrapers.

Examples

Example 1

Loading
Loading