Minimum Jumps

2.7

3 votes
Easy
Problem

You live in a street of 1 dimension and your house is located at point 0. Your best friend's house is located at location x. You can make jumps of 1, 2, 3, 4 or 5 positions at a time. You need to reach x with minimum number of jumps possible. Find this minimum number of jumps needed to reach x from 0.

INPUT

A single line integer x (1 <= x <= 100000), denoting the position of your best friend's house.

OUTPUT

A single line integer containing the answer to the problem, i.e. the minimum number of jumps need to reach x from 0.

Time Limit: 0.5
Memory Limit: 256
Source Limit:
Explanation

You are at postition 0 and want to reach 12. You can make 3 jumps of 3, 4 and 5 respectively (0->3->7->12) to reach 12. Note that this is not only the combination through which you reach 12. Also note that you cannot reach 12 in less than 3 jumps.

Editor Image

?