Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ACM-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.

This round has an unusual addition to the rules. For each problem you must use distinct language. Thus, if you have a submission that has passed at least one test or is being tested at the moment, then for this task you can use only this language and can not use it for other tasks. More details can be read by the link. Different implementations of the same language are considered to be the same language (for example, in C++ you can only solve one problem, regardless of the exact chosen compiler).

No tag edit access

B. Add Points

time limit per test

1 secondmemory limit per test

256 megabytesinput

standard inputoutput

standard outputThere are *n* points on a straight line, and the *i*-th point among them is located at *x*_{i}. All these coordinates are distinct.

Determine the number *m* — the smallest number of points you should add on the line to make the distances between all neighboring points equal.

Input

The first line contains a single integer *n* (3 ≤ *n* ≤ 100 000) — the number of points.

The second line contains a sequence of integers *x*_{1}, *x*_{2}, ..., *x*_{n} ( - 10^{9} ≤ *x*_{i} ≤ 10^{9}) — the coordinates of the points. All these coordinates are distinct. The points can be given in an arbitrary order.

Output

Print a single integer *m* — the smallest number of points you should add on the line to make the distances between all neighboring points equal.

Examples

Input

3

-5 10 5

Output

1

Input

6

100 200 400 300 600 500

Output

0

Input

4

10 9 0 -1

Output

8

Note

In the first example you can add one point with coordinate 0.

In the second example the distances between all neighboring points are already equal, so you shouldn't add anything.

Codeforces (c) Copyright 2010-2019 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Mar/24/2019 02:40:26 (d2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|