#include <bits/stdc++.h>
const int mod = 1e9 + 7;
using namespace std;
int n;
int x[100050];
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &x[i]);
  if (n == 2) {
    cout << "0" << endl;
    return 0;
  }
  sort(x, x + n);
  int tmp = x[1] - x[0];
  for (int i = 1; i < n - 1; i++) {
    tmp = gcd(tmp, x[i + 1] - x[i]);
  }
  int ans = 0;
  for (int i = 1; i < n; i++) ans += ((x[i] - x[i - 1]) / tmp) - 1;
  cout << ans << endl;
  return 0;
}
