Олимпиадный тренинг

Задача 38348. Count the lamps


The new metro station, which is scheduled to open at the end of this year, will have N escalators (the escalators are numbered consecutively from 1 to N). The escalators have a length L and are located at a distance H from each other. We will neglect the width of the escalator. Between each two adjacent escalators (exactly in the middle) a row of lamps will be installed. There will be K lamps in a row. Lamps are installed according to the following principle: the entire length of the escalator L is divided into K equal segments and a lamp is installed in the middle of each segment (see figure). A total of (N–1)*K lamps will be installed.


In the above figure, N=4 (escalators are shown in bold <horizontal lines), L=20, H=4, K=5.

Vasya managed to get into this station even before it opened, and even ride the escalator. He chose escalator number J. Calculate how many points on the escalator (including its beginning and end) Vasya will not see all the lamps (because other lamps will block them).

Input
The input file contains numbers N, L, H, K, J. All numbers — natural. 2≤N≤35, 1≤L≤1000, 1≤H≤1000, 1≤K≤35, 1≤J≤N.

Imprint
In the output file print a single number — task response.
Examples
# Input Output
1 2 20 4 5 1 0
2 4 20 4 5 2 11