#include using namespace std; const int INF = 1000000; int main(){ int N; cin >> N; vector x(N), r(N); for (int i = 0; i < N; i++){ cin >> x[i] >> r[i]; } vector L(N), R(N); for (int i = 0; i < N; i++){ L[i] = x[i] - r[i]; R[i] = x[i] + r[i]; } vector X; for (int i = 0; i < N; i++){ X.push_back(L[i]); X.push_back(R[i]); } sort(X.begin(), X.end()); X.erase(unique(X.begin(), X.end()), X.end()); int cnt = X.size(); for (int i = 0; i < N; i++){ L[i] = lower_bound(X.begin(), X.end(), L[i]) - X.begin(); R[i] = lower_bound(X.begin(), X.end(), R[i]) - X.begin(); } vector imos(cnt + 1, 0); for (int i = 0; i < N; i++){ imos[L[i]]++; imos[R[i]]--; } for (int i = 0; i < cnt; i++){ imos[i + 1] += imos[i]; } int ans = 0; for (int i = 0; i < cnt; i++){ ans = max(ans, imos[i]); } cout << ans << endl; }