

from collections import deque
line = list(map(int, input().split()))
F, S, G, U, D = line[0], line[1], line[2], line[3], line[4]
def bfs(F, S, G, U, D):
q = deque()
visited = set()
q.append((S, 0))
visited.add(S)
while q:
n, turn = q.popleft()
if n == G:
return turn
if n - D > 0 and n - D not in visited:
q.append((n - D, turn + 1))
visited.add(n - D)
if n + U <= F and n + U not in visited:
q.append((n + U, turn + 1))
visited.add(n + U)
return -1
res = bfs(F, S, G, U, D)
if res == -1:
print('use the stairs')
else:
print(res)