#include using namespace std; int main(){ int a; cin >> a; if(a <= 7){ cout << -1 << endl; return 0; } int ans; for(int i = 8;;++i){ if(a % i != 7) continue; if(i * 1 < a && i * 2 > a){ ans = i; break; } } cout << ans << endl; return 0; }