#include <bits/stdc++.h>
using namespace std;
int gcd(long long int a, long long int b) { return b ? gcd(b, a % b) : a; }
int main() {
  long long int n, b, sum = 0, k, mx, mn;
  cin >> n;
  long long int *mas = new long long int[n];
  for (int i = 0; i < n; i++) {
    cin >> mas[i];
  }
  sort(mas, mas + n);
  b = mas[1] - mas[0];
  mx = mas[0];
  mn = mas[0];
  for (int i = 1; i < n - 1; i++) {
    mx = max(mx, mas[i]);
    mn = min(mn, mas[i]);
    if (b != mas[i + 1] - mas[i]) {
      if (gcd(b, mas[i + 1] - mas[i]) == b) {
        sum += (mas[i + 1] - mas[i]) / b - 1;
      } else {
        k = b;
        b = gcd(b, mas[i + 1] - mas[i]);
        if (sum == 0)
          sum += k / b - 1;
        else
          sum *= k / b;
        sum += (mas[i + 1] - mas[i]) / b - 1;
      }
    }
  }
  mx = max(mx, mas[n - 1]);
  mn = min(mn, mas[n - 1]);
  sum = 0;
  sum = (mx - mn) / b - n + 1;
  cout << sum;
}
