
#include <iostream>
#include <sstream>
#include <list>
#include <vector>
using namespace std;

int longest(const list< vector<int> >& L);

int main() {
   int x;
   string line;
   list< vector<int> > L;
   while (getline(cin, line)) {
      vector<int> v;
      istringstream S(line);
      while (S >> x) {
         v.push_back(x);
      }
      L.push_back(v);
   }
   cout << longest(L) << endl;
}
