Package for this problem was not updated by the problem writer or Codeforces administration after we’ve upgraded the judging servers. To adjust the time limit constraint, solution execution time will be multiplied by 2. For example, if your solution works for 400 ms on judging servers, then value 800 ms will be displayed and used to determine the verdict.

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

The problem statement has recently been changed. View the changes.

×
D. Analyzing Polyline

time limit per test

2 secondsmemory limit per test

256 megabytesinput

standard inputoutput

standard outputAs Valeric and Valerko were watching one of the last Euro Championship games in a sports bar, they broke a mug. Of course, the guys paid for it but the barman said that he will let them watch football in his bar only if they help his son complete a programming task. The task goes like that.

Let's consider a set of functions of the following form:

Valeric and Valerko really want to watch the next Euro Championship game, so they asked you to help them.

Input

The first line contains integer *n* (1 ≤ *n* ≤ 10^{5}) — the number of functions. Each of the following *n* lines contains two space-separated integer numbers *k*_{i}, *b*_{i} ( - 10^{9} ≤ *k*_{i}, *b*_{i} ≤ 10^{9}) that determine the *i*-th function.

Output

Print a single number — the number of angles that do not equal 180 degrees in the graph of the polyline that equals the sum of the given functions.

Examples

Input

1

1 0

Output

1

Input

3

1 0

0 2

-1 1

Output

2

Input

3

-2 -4

1 7

-5 1

Output

3

Codeforces (c) Copyright 2010-2021 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Apr/12/2021 14:51:59 (j3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|