Valera runs a 24/7 fast food cafe. He magically learned that next day n people will visit his cafe. For each person we know the arrival time: the i-th person comes exactly at hi hours mi minutes. The cafe spends less than a minute to serve each client, but if a client comes in and sees that there is no free cash, than he doesn't want to wait and leaves the cafe immediately. 

Valera is very greedy, so he wants to serve all n customers next day (and get more profit). However, for that he needs to ensure that at each moment of time the number of working cashes is no less than the number of clients in the cafe. 

Help Valera count the minimum number of cashes to work at his cafe next day, so that they can serve all visitors.

Input

The first line contains a single integer n (1 ≤ n ≤ 105), that is the number of cafe visitors.

Each of the following n lines has two space-separated integers hi and mi (0 ≤ hi ≤ 23; 0 ≤ mi ≤ 59), representing the time when the i-th person comes into the cafe. 

Note that the time is given in the chronological order. All time is given within one 24-hour period.

Output

Print a single integer — the minimum number of cashes, needed to serve all clients next day.

Examples

Input

4
8 0
8 10
8 10
8 45


Output

2


Input

3
0 12
10 11
22 22


Output

1

Note

In the first sample it is not enough one cash to serve all clients, because two visitors will come into cafe in 8:10. Therefore, if there will be one cash in cafe, then one customer will be served by it, and another one will not wait and will go away.

In the second sample all visitors will come in different times, so it will be enough one cash.
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
import java.lang.*;
public class MAIn{
	static int mod = 1000000007;
	static InputReader in = new InputReader(System.in);
	static PrintWriter pw = new PrintWriter(System.out);
	public static void main(String[] args) throws Exception {
		//int t=in.readInt();
		//while(t-->0){
		int n=in.readInt();
		int[] a=new int[n];
		for(int i=0;i<n;i++) {
			int p=in.readInt();
			a[i]=in.readInt();
			a[i]+=60*p;
		}
		int ans=0,flag=0;
		for(int i=0;i<n-1;i++) {
			int count=0;
			while(a[i]==a[i+1]) {
				i++;
				count++;
				flag=1;
				if(i>=n-1)
					break;
			}
			if(flag==1){
				i--;
				flag=0;
			}
			ans=Math.max(ans,count);
		}
		System.out.println(ans+1);
		
	}
	
	static String sort(String s1) {
		String s2="";
		int n1=s1.length();
		int[] a=new int[n1];
		for(int i=0;i<n1;i++){
			a[i]=s1.charAt(i);
		}
		Arrays.sort(a);
		for(int i=0;i<n1;i++) {
			s2+=(char)a[i];
		}
		return s2;
	}
	static String  reverse(String s1) {
		String s2="";
		for(int i=s1.length()-1;i>=0;i--) {
			s2+=s1.charAt(i);
		}
		return s2;
	}
	static boolean isVowel(char c) {
		if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u')
			return true;
		return false;
	}
	static String removeChar(String s,int a,int b) {
		return s.substring(0,a)+s.substring(b,s.length());
	}
	static int[]  nextIntArray(int n){
		int[] arr= new int[n];
		int i=0;
		while(i<n){
			arr[i++]=in.readInt();
		}
		return arr;
	}
	static long[] nextLongArray(int n){
		long[]arr= new long[n];
		int i=0;
		while(i<n){
			arr[i++]=in.readLong();
		}
		return arr;
	}	
	static int[]  nextIntArray1(int n) {
		int[] arr= new int[n+1]; 
		int i=1;
		while(i<=n){
			arr[i++]=in.readInt();
		}
		return arr;
	}	    	
	static long[] nextLongArray1(int n){
		long[]arr= new long[n+1];
		int i=1;
		while(i<=n) {
			arr[i++]=in.readLong();
		}
		return arr;
	}	  
	static long gcd(long x, long y) {
		if (x % y == 0)
			return y;
		else
			return gcd(y, x % y);
	}
	static long pow(long n, long m) {
		if(m==0)
			return 1;
		else if(m==1)
			return n;
		else {
			long r=pow(n,m/2);
			if(m%2==0)
				return r*r;
			else
				return r*r*n;
		}
	}
	static long max(long a,long b,long c) {
		return Math.max(Math.max(a, b),c);
	}
	static long min(long a,long b,long c) {
		return Math.min(Math.min(a, b), c);
	}
	static class Pair implements Comparable<Pair> {
		int a, b;
		Pair(int a, int b) {
			this.a = a;
			this.b = b;
		}
		public int compareTo(Pair o) {
			if (this.a != o.a)
				return Integer.compare(this.a, o.a);
			else
				return Integer.compare(this.b, o.b);
			// return 0;
		}
		public boolean equals(Object o) {
			if (o instanceof Pair) {
				Pair p = (Pair) o;
				return p.a == a && p.b == b;
			}
			return false;
		}
		public int hashCode() {
			return new Integer(a).hashCode() * 31 + new Integer(b).hashCode();
		}
	}
	static class InputReader {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;
		public InputReader(InputStream stream) {
			this.stream = stream;
		}
		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}
		public int readInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
		public String readString() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}
		public double readDouble() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			double res = 0;
			while (!isSpaceChar(c) && c != '.') {
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, readInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			if (c == '.') {
				c = read();
				double m = 1;
				while (!isSpaceChar(c)) {
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, readInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}
		public long readLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}
}