Noisy Neighbors
In a fairy-tale land, there are N dwarfs, each living in a house situated along a straight line. Every dwarf owns a musical instrument that they enjoy playing. However, each dwarf believes they are the only true musician. Consequently, if a dwarf hears music from any other dwarf, they become very upset, feeling disturbed. In such cases, they file complaints to the king about every other dwarf whose music they can hear.
Your task is to write a program that calculates the total number of complaints the king will receive.
Input
The first line contains an integer N (1 ≤ N ≤ 10^5). Each of the next N lines contains two integers x_i and r_i (-10^9 ≤ x_i ≤ 10^9, 0 ≤ r_i ≤ 10^9), representing the coordinate of the dwarf's house and the maximum distance their music can be heard, respectively.
Output
Output a single line with the total number of complaints.