#include <iostream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <iterator>
#include <functional>
#include <complex>
#include <queue>
#include <stack>
#include <cmath>
#include <cassert>
using namespace std;
typedef long long LL;
typedef long double LD;
typedef complex<double> CMP;
class EelAndRabbit { public:
int getmax(vector <int> l, vector <int> t)
{
const int N = l.size();
vector<int> ps;
for(int i=0; i<N; ++i) {
ps.push_back(t[i]);
ps.push_back(t[i]+l[i]);
}
int best = 0;
for(int i=0; i<ps.size(); ++i)
for(int k=0; k<ps.size(); ++k) {
int p = ps[i], q = ps[k];
int cat = 0;
for(int x=0; x<N; ++x)
{
if(t[x]<=p && p<=t[x]+l[x]
|| t[x]<=q && q<=t[x]+l[x])
++cat;
}
best = max(best, cat);
}
return best;
}
};
// BEGIN CUT HERE
#include <ctime>
double start_time; string timer()
{ ostringstream os; os << " (" << int((clock()-start_time)/CLOCKS_PER_SEC*1000) << " msec)"; return os.str(); }
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v)
{ os << "{ ";
for(typename vector<T>::const_iterator it=v.begin(); it!=v.end(); ++it)
os << '\"' << *it << '\"' << (it+1==v.end() ? "" : ", "); os << " }"; return os; }
void verify_case(const int& Expected, const int& Received) {
bool ok = (Expected == Received);
if(ok) cerr << "PASSED" << timer() << endl; else { cerr << "FAILED" << timer() << endl;
cerr << "\to: \"" << Expected << '\"' << endl << "\tx: \"" << Received << '\"' << endl; } }
#define CASE(N) {cerr << "Test Case #" << N << "..." << flush; start_time=clock();
#define END verify_case(_, EelAndRabbit().getmax(l, t));}
int main(){
CASE(0)
int l_[] = {2, 4, 3, 2, 2, 1, 10};
vector <int> l(l_, l_+sizeof(l_)/sizeof(*l_));
int t_[] = {2, 6, 3, 7, 0, 2, 0};
vector <int> t(t_, t_+sizeof(t_)/sizeof(*t_));
int _ = 6;
END
CASE(1)
int l_[] = {1, 1, 1};
vector <int> l(l_, l_+sizeof(l_)/sizeof(*l_));
int t_[] = {2, 0, 4};
vector <int> t(t_, t_+sizeof(t_)/sizeof(*t_));
int _ = 2;
END
CASE(2)
int l_[] = {1};
vector <int> l(l_, l_+sizeof(l_)/sizeof(*l_));
int t_[] = {1};
vector <int> t(t_, t_+sizeof(t_)/sizeof(*t_));
int _ = 1;
END
CASE(3)
int l_[] = {8, 2, 1, 10, 8, 6, 3, 1, 2, 5};
vector <int> l(l_, l_+sizeof(l_)/sizeof(*l_));
int t_[] = {17, 27, 26, 11, 1, 27, 23, 12, 11, 13};
vector <int> t(t_, t_+sizeof(t_)/sizeof(*t_));
int _ = 7;
END
/*
CASE(4)
int l_[] = ;
vector <int> l(l_, l_+sizeof(l_)/sizeof(*l_));
int t_[] = ;
vector <int> t(t_, t_+sizeof(t_)/sizeof(*t_));
int _ = ;
END
CASE(5)
int l_[] = ;
vector <int> l(l_, l_+sizeof(l_)/sizeof(*l_));
int t_[] = ;
vector <int> t(t_, t_+sizeof(t_)/sizeof(*t_));
int _ = ;
END
*/
}
// END CUT HERE