import java.util.*; import java.lang.*; import java.io.*; public class Main { public static void main (String[] args) throws java.lang.Exception { // your code goes here // 入力 Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[] X = new int[N]; int[] R = new int[N]; for(int i = 0; i < N; i++){ X[i] = sc.nextInt(); R[i] = sc.nextInt(); } // 円の左端、右端配列を作成 int[] left = new int[N]; int[] right = new int[N]; for(int i = 0; i < N; i++){ left[i] = X[i] - R[i]; right[i] = X[i] + R[i]; } Arrays.sort(left); Arrays.sort(right); // 重なり合う円のカウント int circle = 0; int max = 0; int indexL = 0; int indexR = 0; while(indexL < N && indexR < N){ if(indexL == N){ circle--; indexR++; } else if(indexR == N){ circle++; indexL++; } else if(left[indexL] < right[indexR]){ circle++; indexL++; } else{ circle--; indexR++; } if(max < circle){ max = circle; } } // 出力 System.out.println(max); } }