#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
long long qp(long long b, long long r) {
  long long ans = 1;
  long long k = r;
  while (r) {
    if (r & 1) ans = ans * b % mod;
    b = b * b % mod;
    r >>= 1;
  }
  return ans;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long arr[100008];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%I64d", &arr[i]);
  }
  sort(arr, arr + n);
  long long tmp = gcd(arr[2] - arr[1], arr[1] - arr[0]);
  for (int i = 3; i < n; ++i) {
    tmp = gcd(tmp, arr[i] - arr[i - 1]);
  }
  printf("%I64d\n", ((arr[n - 1] - arr[0]) / tmp) + 1 - n);
  return 0;
}
