#include <bits/stdc++.h>
using namespace std;
int Nod(int a, int b) {
  while (a && b)
    if (a >= b)
      a %= b;
    else
      b %= a;
  return a | b;
}
int NodArray(vector<int> a, int n) {
  int i, nod = 0;
  for (i = 0; i < n; i++) nod = Nod(a[i], nod);
  return nod;
}
int main() {
  int n;
  cin >> n;
  vector<int> a(n), b(n - 1);
  for (int i = 0; i != n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  for (int i = 0; i != n - 1; i++) {
    b[i] = abs(a[i] - a[i + 1]);
  }
  int nod = NodArray(b, n - 1);
  cout << (a[n - 1] - a[0]) / (nod) - (n - 1);
  return 0;
}
