#include using namespace std; int main() { int a,x; cin >> a; x = a - 7; if (x < 8) cout << -1 << endl; else cout << x << endl; }