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 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) maidx = hl.index(max(hl)) miidx = hl.index(min(hl)) if hl[maidx] - hl[1] > hl[1] - hl[miidx]: print(math.ceil((hl[1] - hl[miidx]) / d) + (0 if (hl[1] - hl[miidx]) % d != 0 else 1)) else: print(math.ceil((hl[maidx] - hl[1]) / d) + (0 if (hl[maidx] - hl[1]) % d != 0 else 1))