#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
int n;
int a[maxn];
int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
inline int read() {
  int ret = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -f;
    ch = getchar();
  }
  while (isdigit(ch)) {
    ret = ret * 10 + ch - '0';
    ch = getchar();
  }
  return ret * f;
}
signed main() {
  n = read();
  for (int k = 1; k <= n; k++) a[k] = read();
  sort(a + 1, a + n + 1);
  int len = a[n] - a[1];
  for (int k = 2; k <= n; k++) len = gcd(len, a[k] - a[k - 1]);
  printf("%d\n", (a[n] - a[1]) / len + 1 - n);
  return 0;
}
