Written By : MathModel
Since is small then we can brute force choices for and and we choose
Complexity \mathcal{O}(201^2).
n=int(input())
ans=10**18
for x in range(-100,100):
for y in range(-100,100):
if(5*x+3*y==n):
ans=min(ans,abs(x)+abs(y))
print(ans)