#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9;
const long long N = 3e5 + 5;
const long long M = 5500;
const long long mod = 1e9 + 7;
const long double eps = 1E-7;
long long n, a[N], cnt;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n);
  long long d = a[2] - a[1];
  for (int i = 3; i <= n; i++) d = gcd(a[i] - a[i - 1], d);
  for (int i = 1; i < n; i++) {
    if (a[i + 1] - a[i] != d) cnt += (a[i + 1] - a[i]) / d - 1;
  }
  cout << cnt;
}
