You are given an infinite 2-d grid with the bottom left cell referenced as (1,1). All the cells contain a value of zero initially. Let's play a game?
The game consists of N steps wherein each step you are given two integers a and b. The value of each of the cells in the co-ordinate (u, v) satisfying 1 ≤ u ≤ a and 1 ≤ v ≤ b, is increased by 1. After N such steps, if X is the largest number amongst all the cells in the rectangular board, can you print the number of X's in the board?
The first line of input contains a single integer N. N lines follow.
Each line contains two integers a and b separated by a single space.
Output a single integer - the number of X's.
1 ≤ N ≤ 100
1 ≤ a ≤ 106
1 ≤ b ≤ 106
Assume that the following board corresponds to cells (i, j) where 1 ≤ i ≤ 4 and 1 ≤ j ≤ 7.