#include #include #include #include #include #include #include #include #include #include using ll = long long; using namespace std; int main() { ll n; cin >> n; cout << (!(n%2) ? n/2 : ((n/2)%2) ? (n/4 + 1) : ((n-1)/4+1)) << endl; }