N = int(input())
max5 = N // (5 * 10)
list1 = []
for i in range(max5 + 1):
rest = N - 10 * 5 * i
count = i * (5 + 2)
max3 = rest // (10 * 3)
count += max3 * (3 + 1)
rest -= max3 * 3 * 10
if rest >= 10:
count += rest // 10
list1.append(count)
print(max(list1))