4615: P1413 坚果保龄球

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Input

Output

Sample Input Copy

10
1 1
1 61
2 1
2 60
3 1
3 2
3 3
3 4
4 1
4 99999

Sample Output Copy

6

HINT