n,*x = map(int,open(0).read().split()) L = x[0] g = x[0] = 0 ans = n-1 for i in range(n-2,-1,-1): g += x[i+1] if 2*(n-1-i)*max(x[i],x[i+1]) < 2*g+L*(n-1-i) < 2*(n-1-i)*(min(x[i],x[i+1])+L): ans -= 1 if abs(x[i+1]-x[i]) >= L: ans = -1 print(max(ans,-1))