eolymp
bolt
Try our new interface for solving problems
Problems

Split into composite numbers

Split into composite numbers

Time limit 1 second
Memory limit 128 MiB

What is the largest number of composite integers can be used to represent the number n as a sum of composite numbers?

Note: A positive integer that has a divisor other than itself and 1 is called a composite.

Input data

One integer n (1n10^18).

Output data

Print the largest number of composite integers that can be used so that their sum equals n. If n cannot be represented as a sum of composite numbers, print -1.

Examples

Input example #1
8
Output example #1
2
Input example #2
6
Output example #2
1
Input example #3
15
Output example #3
2
Input example #4
7
Output example #4
-1
Source 2022 Azerbaijan Round 1, 10-11 classes