#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:5000000000")
const unsigned long long mod = 1000000007;
long long Inf = (long long)2e9;
long long LINF = (long long)1e18 + 1e17;
int gcd(int a, int b) {
  if (b) return gcd(b, a % b);
  return a;
}
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort((a).begin(), (a).end());
  vector<int> b;
  for (int i = 1; i < n; i++) {
    b.push_back(a[i] - a[i - 1]);
  }
  int g = b[0];
  for (int i = 1; i < b.size(); i++) g = gcd(g, b[i]);
  int need = (a.back() - a[0]) / g;
  cout << need - (n - 1);
  return 0;
}
