Under construction

Still being built. Things may change

Blade Tips

Interview

Time limit2sMemory limit1024 MB

Summary
Given n tips with values x and y, find the largest subset where every x+y sum is distinct, which is the count of distinct sums.
Level

Easy3 of 10

Topics
Hash map, Implementation
Solved
No attempts yet

Problem

Before the battle, Logan concluded that blade tips could greatly raise his chances of winning, so he decided to order a full set.

The set has nn tips. Nothing in the world is perfect, so each ii-th tip is described by a pair (xi,yi)(x_i, y_i): the number of abilities it improves and the number it worsens, respectively. Logan decided to choose only part of the set. A subset is called maximally effective if for any two tips ii and jj (i≠ji \neq j), the inequality xi−yj≠xj−yix_i - y_j \neq x_j - y_i holds.

What is the maximum number of tips that can be chosen so that the subset is maximally effective?

Input

The first line contains a natural number nn, the number of tips in the original set (1≤n≤1051 \le n \le 10^5).

Each of the next nn lines contains two integers xix_i and yiy_i, describing the ii-th tip (1≤xi,yi≤1091 \le x_i, y_i \le 10^9).

Output

Print one number, the answer to the problem.

Examples1

  1. Example 1

    Input
    5
    4 5
    2 8
    1 3
    7 3
    6 5
    
    Expected output
    4