Sugar Delivery

Time limit1sMemory limit128 MB

Problem

Sanggeun delivers sugar from a sugar factory to a candy store. This time, he must deliver exactly N kilograms of sugar.

The sugar is available only in 3-kilogram bags and 5-kilogram bags. Sanggeun wants to carry as few bags as possible.

Find the minimum number of bags needed to make exactly N kilograms. If it is impossible, output -1.

Input

The first line contains an integer N.

3 <= N <= 5000

Output

Print the minimum number of bags needed to deliver exactly N kilograms.

If it is impossible to make exactly that amount, print -1.