#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  while (b > 0) {
    a = a % b;
    swap(a, b);
  }
  return a;
}
vector<int> a;
int n;
int main() {
  cin >> n;
  a.resize(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  int q = a[1] - a[0];
  for (int i = 2; i < n; i++) q = gcd(q, a[i] - a[i - 1]);
  int ans = 0;
  for (int i = 1; i < n; i++) ans += (a[i] - a[i - 1]) / q - 1;
  cout << ans;
  return 0;
}
