// Arup Guha
// 12/15/2022
// Solution to 2011 NCPC Problem: Elevator Trouble
// Illustrate BFS for ICPC Lecture

import java.util.*;

public class elevatortrouble {

	public static void main(String[] args) {

		// Read input make floors 0-based.
		Scanner stdin = new Scanner(System.in);
		int floors = stdin.nextInt();
		int start = stdin.nextInt()-1;
		int end = stdin.nextInt()-1;
		int up = stdin.nextInt();
		int down = stdin.nextInt();

		// Store distances here. Use -1 to mean not reached.
		int[] dist = new int[floors];
		Arrays.fill(dist, -1);

		// Set up BFS.
		LinkedList<Integer> q = new LinkedList<Integer>();
		q.offer(start);
		dist[start] = 0;

		// Run bfs.
		while (q.size() > 0) {

			int cur = q.poll();
			if (cur == end) break;

			// Try going up.
			int next = cur + up;
			if (next >= 0 && next < floors && dist[next] == -1) {
				q.offer(next);
				dist[next] = dist[cur] + 1;
			}

			// And down.
			next = cur - down;
			if (next >= 0 && next < floors && dist[next] == -1) {
				q.offer(next);
				dist[next] = dist[cur] + 1;
			}
		}

		// Ta da!
		if (dist[end] != -1) System.out.println(dist[end]);
		else				 System.out.println("use the stairs");
	}
}