#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (a % b == 0) {
    return b;
  } else {
    return gcd(b, a % b);
  }
}
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  int g = v[1] - v[0];
  for (int i = 2; i < n; ++i) {
    g = gcd(g, v[i] - v[i - 1]);
  }
  cout << (v.back() - v.front()) / g - (int)v.size() + 1;
}
