问题 5256 --Elephant(大象)

5256: Elephant(大象)★★

时间限制: 1 Sec  内存限制: 256 MB
提交: 123  解决: 74
[提交][状态][命题人:]

题目描述

An elephant decided to visit his friend. It turned out that the elephant's house is located at point 0 and his friend's house is located at point x(x > 0) of the coordinate line. In one step the elephant can move 1234 or 5 positions forward. Determine, what is the minimum number of steps he need to make in order to get to his friend's house.

一头大象决定去拜访他的朋友。大象的房子位于数轴上的0点,它的朋友的房子位于数轴上的x(x > 0)上。大象可以一步向前移动12345个坐标点。试确定他到达朋友家所需的最少步数。


输入

The first line of the input contains an integer x (1 ≤ x ≤ 1 000 000) — The coordinate of the friend's house.

输入的第一行包含一个整数x (1x1 000 000)x为朋友家的坐标)。

输出

Print the minimum number of steps that elephant needs to make to get from point 0 to point x.

输出出大象走到朋友家所需的最少步数


样例输入
Copy
input1
5
input2
12
样例输出
Copy
output1
1
output2
3

提示

In the first sample the elephant needs to make one step of length 5 to reach the point x.

对于样例一,大象只需要移动 1次,走五个单位即可到达点 x 。

In the second sample the elephant can get to point x if he moves by 35 and 4. There are other ways to get the optimal answer but the elephant cannot reach x in less than three moves.

对于样例二,大象可以移动 3 次,走三个单位,五个单位以及四个单位;虽然存在其他到达点 x 的走法,但是移动次数不会少于 3。

来源

 

[提交][状态]