int N;

int main(){

    cin>>N;

    cout<<(N-4?N---7?1+N/5+N%5%2:-1:-1)<<endl;

}