import math d = int(input()) H = [] H.append(int(input())) H.append(int(input())) H.append(int(input())) if (H[1] == max(H) or H[1] == min(H)) and (H[0] != H[1] and H[1] != H[0]): print(0) exit() if d == 0: print(-1) exit() if H[1] == 0 and (H[0] == H[1] or H[1] == H[2]): print(-1) exit() if H[0] == H[2] and H[0] == 0: print(-1) exit() cnt = 0 if H[0] == H[2]: H[2] = max(H[2]-d, 0) cnt += 1 if H[0] < H[2]: H[0], H[2] = H[2], H[0] diff = 0 if H[2] == 0: diff = H[2] - H[1] else: diff = min(H[0] - H[1], H[1] - H[2]) print(int(math.ceil((diff+0.5)/d)) + cnt)