#include <bits/stdc++.h>
using namespace std;
int a[1000005], g, ans;
int gcd(int a, int b) {
  if (!b) return a;
  return gcd(b, a % b);
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  for (int i = 1; i < n; i++) {
    g = gcd(g, a[i + 1] - a[i]);
  }
  for (int i = 1; i < n; i++) ans += (a[i + 1] - a[i]) / g - 1;
  printf("%d", ans);
}
