#include <bits/stdc++.h>
using namespace std;
int read() {
  int f = 1, x = 0;
  char s = getchar();
  while (s < '0' || s > '9') {
    if (s == '-') f = -1;
    s = getchar();
  }
  while (s >= '0' && s <= '9') {
    x = x * 10 + s - '0';
    s = getchar();
  }
  return x * f;
}
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int n, m, i, j, k, s, o;
int x[100005];
int c[100005];
int main() {
  n = read();
  for (int i = 1; i <= n; i++) x[i] = read();
  sort(x + 1, x + 1 + n);
  int sum = x[n] - x[1];
  int gc = sum;
  for (int i = 1; i < n; i++) {
    c[i] = x[i + 1] - x[i];
    gc = gcd(gc, c[i]);
  }
  sum /= gc;
  printf("%d\n", sum - n + 1);
  return 0;
}
