728x90
package Greedy;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
class Change {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
int expect = n / 5;
int rest = n % 5;
while (rest % 2 > 0) {
if(expect ==0){
System.out.println(-1);
return;
}
expect--;
rest = n - 5 * expect;
}
int answer = rest / 2 + expect;
System.out.println(answer);
return;
}
}