#include using namespace std; int main() { int N; cin >> N; vector x( N ); vector r( N ); for( int i = 0; i < N; i++ ) { cin >> x[i] >> r[i]; } const int n = 100000; vector a( 2 * n + 1 ); for( int i = 0; i < N; i++ ) { int l = max( 0, x[i] - r[i] + n ); int rr = x[i] + r[i] + n; a[l]++; if( rr <= 2 * n ) a[rr]--; } for( int i = 0; i < 2 * n; i++ ) { a[i + 1] += a[i]; } int ans = 0; for( int i = 0; i < 2 * n + 1; i++ ) { ans = max( ans, a[i] ); } cout << ans << endl; }