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