#include <bits/stdc++.h>
using namespace std;
const int inf = 987654321;
const int sz = (int)1e6 + 5;
const int mod = (int)1e9 + 7;
const int sqrtn = 300;
int n;
int a[sz];
int gcd(int x, int y) {
  if (x == 0) return y;
  return gcd(y % x, x);
}
int main() {
  cin >> n;
  for (int i = (int)1; i <= (int)n; ++i) cin >> a[i];
  sort(a + 1, a + n + 1);
  int tmp = 0;
  for (int i = (int)2; i <= (int)n; ++i) tmp = gcd(tmp, a[i] - a[i - 1]);
  int res = (a[n] - a[1]) / tmp + 1 - n;
  cout << res << endl;
  return 0;
}
