#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) {
  while (y != 0) {
    x %= y;
    swap(x, y);
  }
  return x;
}
int arr[100000];
int main() {
  int n, i, g, ans;
  cin >> n;
  for (i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  g = arr[1] - arr[0];
  for (i = 1; i < n - 1; i++) g = gcd(g, arr[i + 1] - arr[i]);
  ans = (arr[n - 1] - arr[0]) / g - 1 - (n - 2);
  cout << ans;
  return 0;
}
