import math d = int(input()) hl = [int(input()) for i in range(3)] # 3 3 4 or 3 3 2 if hl[1] == hl[0] or hl[1] == hl[2]: # 0 0 2 NG print(1 if hl[1] > 0 and d > 0 else -1) exit(0) # 5 7 5 or 2 0 1 if max(hl) == hl[1] or min(hl) == hl[1]: print(0) exit(0) if d == 0: print(-1) exit(0) maidx = hl.index(max(hl)) miidx = hl.index(min(hl)) if min(hl) > 0: flagment = 0 if hl[maidx] - hl[1] > hl[1] - hl[miidx]: flagment = hl[1] - hl[miidx] else: flagment = hl[maidx] - hl[1] print(math.ceil(flagment / d) if flagment % d != 0 else math.ceil(flagment / d) + 1) else: flagment = hl[maidx] - hl[1] print(math.ceil(flagment / d) if flagment % d != 0 else math.ceil(flagment / d) + 1)