#include <bits/stdc++.h>
using namespace std;
long getgcd(long a, long b) {
  if (a == 0) return b;
  return getgcd(b % a, a);
}
int main() {
  int N;
  scanf("%d", &N);
  int a[N];
  for (int i = 0; i < N; i++) scanf("%d", &a[i]);
  sort(a, a + N);
  if (N <= 2) {
    printf("0\n");
    return 0;
  }
  long diff[N - 1];
  for (int i = 0; i < N - 1; i++) {
    diff[i] = a[i + 1] - a[i];
  }
  long gcd = diff[0];
  for (int i = 0; i < N - 1; i++) gcd = getgcd(gcd, diff[i]);
  long ret = 0;
  for (int i = 0; i < N - 1; i++) {
    ret += diff[i] / gcd - 1;
  }
  printf("%ld\n", ret);
}
