#include<iostream>
using namespace std;
#define MAX 11111
int a[MAX][2];
int main()
{ int t;
cin>>t;
for(int i=0;i<t;i++)
cin>>a[i][0]>>a[i][1];
int cash=1;
int maxcash=1;
for(int i=0;i<(t-1);i++)
{
if(a[i+1][0]==a[i][0])
{
if(a[i+1][1]==a[i][1])
cash++;
else
{
if(maxcash<cash)
maxcash=cash;
cash=1;
}
}
else
{
if(maxcash<cash)
maxcash=cash;
cash=1;
}
}
if(maxcash<cash)
maxcash=cash;
cout<<maxcash<<endl;
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgTUFYIDExMTExCmludCBhW01BWF1bMl07CmludCBtYWluKCkKeyBpbnQgdDsKIGNpbj4+dDsKIGZvcihpbnQgaT0wO2k8dDtpKyspCiAgY2luPj5hW2ldWzBdPj5hW2ldWzFdOwogIGludCBjYXNoPTE7CiAgaW50IG1heGNhc2g9MTsKICBmb3IoaW50IGk9MDtpPCh0LTEpO2krKykKICB7CiAgICAgIGlmKGFbaSsxXVswXT09YVtpXVswXSkKICAgICB7CiAgICAgICBpZihhW2krMV1bMV09PWFbaV1bMV0pCiAgICAgICAgIGNhc2grKzsKICAgICAgICBlbHNlCiAgICAgICAgICB7CiAgICAgICAgICAgICAgaWYobWF4Y2FzaDxjYXNoKQogICAgICAgICAgICBtYXhjYXNoPWNhc2g7CiAgICAgICAgICAgIGNhc2g9MTsKICAgICAgICAgIH0KICAgICAgIH0KICAgICAgIGVsc2UKICAgICAgICB7CiAgICAgICAgICAgIGlmKG1heGNhc2g8Y2FzaCkKICAgICAgICAgICAgbWF4Y2FzaD1jYXNoOwogICAgICAgICAgICBjYXNoPTE7CiAgICAgICAgfQogIH0KICBpZihtYXhjYXNoPGNhc2gpCiAgICAgICAgICAgIG1heGNhc2g9Y2FzaDsKICAgICAgICAgICBjb3V0PDxtYXhjYXNoPDxlbmRsOwogICAgICAgICAgIHJldHVybiAwOwogICAgICAgICAgIH0=