# 설탕배달
import sys
N = int(sys.stdin.readline())

max_five = N // 5

for i in range(max_five, -1, -1):
    left = N - i * 5
    if left % 3 == 0:
        print(i+left//3)
        exit()
else:print(-1)
        
49074a49c993f1f2c8e642d3686b25c53a1af026
<mask token>

<mask token>
for i in range(max_five, -1, -1):
    left = N - i * 5
    if left % 3 == 0:
        print(i + left // 3)
        exit()
else:
    print(-1)

<mask token>
N = int(sys.stdin.readline())
max_five = N // 5
for i in range(max_five, -1, -1):
    left = N - i * 5
    if left % 3 == 0:
        print(i + left // 3)
        exit()
else:
    print(-1)

import sys
N = int(sys.stdin.readline())
max_five = N // 5
for i in range(max_five, -1, -1):
    left = N - i * 5
    if left % 3 == 0:
        print(i + left // 3)
        exit()
else:
    print(-1)

# 설탕배달
import sys
N = int(sys.stdin.readline())

max_five = N // 5

for i in range(max_five, -1, -1):
    left = N - i * 5
    if left % 3 == 0:
        print(i+left//3)
        exit()
else:print(-1)
        