#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  while ((a != 0) && (b != 0)) {
    if (a > b) {
      a = a % b;
    } else {
      b = b % a;
    }
  }
  return a + b;
}
int main() {
  int n;
  int a[100000];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  int now = gcd(a[1] - a[0], a[2] - a[1]);
  for (int i = 3; i < n; i++) {
    now = gcd(now, a[i] - a[i - 1]);
  }
  int res = 0;
  for (int i = 0; i < (n - 1); i++) {
    res = res + ((a[i + 1] - a[i]) / now) - 1;
  }
  cout << res;
  return 0;
}
