#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long N = 3e5 + 10;
long long gcd(long long n, long long m) {
  if (n == 0)
    return m;
  else
    return gcd(m % n, n);
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  long long a[n + 5];
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  long long k = 0;
  for (long long i = 1; i <= n - 1; i++) {
    k = gcd(k, a[i + 1] - a[i]);
  }
  if (k == 0) {
    cout << 0 << "\n";
    return 0;
  }
  long long ans = 0;
  for (long long i = 1; i <= n - 1; i++) {
    long long dis = a[i + 1] - a[i];
    ans += (dis / k) - 1;
  }
  cout << ans << "\n";
}
