// Arup Guha
// 10/15/2026
// Elevator Trouble - BFS example.
// https://open.kattis.com/problems/elevatortrouble

import java.util.*;

public class elevator {

	public static void main(String[] args) {
	
		// Get all input.
		Scanner stdin = new Scanner(System.in);
		int numFloors = stdin.nextInt();
		int start = stdin.nextInt();
		int end = stdin.nextInt();
		int up = stdin.nextInt();
		int down = stdin.nextInt();
		
		// Set up BFS.
		int[] dist = new int[numFloors+1];
		Arrays.fill(dist, -1);
		dist[start] = 0;
		ArrayDeque<Integer> q = new ArrayDeque<Integer>();
		q.offer(start);
		
		// Run BFS.
		while (q.size() > 0) {
		
			// Get the floor we're on.
			int curF = q.poll();
			
			// Get out.
			if (curF == end) break;
			
			// Try going up.
			if (curF+up <= numFloors && dist[curF+up] == -1) {
				dist[curF+up] = dist[curF] + 1;
				q.offer(curF+up);
			}
			
			// Try going down.
			if (curF-down >= 1 && dist[curF-down] == -1) {
				dist[curF-down] = dist[curF] + 1;
				q.offer(curF-down);
			}
		
		}
		
		// Output result.
		if (dist[end] == -1)
			System.out.println("use the stairs");
		else
			System.out.println(dist[end]);
	}
}