#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; #define MOD 1000000007 int main() { int hoge = 200000; int n; cin >> n; vector x(n), r(n); for (int i = 0; i < n; ++i) { cin >> x[i] >> r[i]; x[i] += hoge; } vector sum(n + 2 * hoge + 1); for (int i = 0; i < n; ++i) { sum[x[i] - r[i]]++; sum[x[i] + r[i]]--; } for (int i = 1; i <= n + 2 * hoge; ++i) { sum[i] += sum[i - 1]; } ll ans = 0; for (int i = 0; i <= n + 2 * hoge; ++i) { ans = max(ans, sum[i]); } cout << ans << endl; return 0; }