#include <iostream>
int kolichestvo_sposobov(long N) {
if (N < 3) return 0;
if (N == 3) return 1;
int a = N / 2;
int b = N - a;
if (a == b) return 2 * kolichestvo_sposobov(a);
return kolichestvo_sposobov(a) + kolichestvo_sposobov(b);
}
int main() {
std::cout << kolichestvo_sposobov(2147483647);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKaW50IGtvbGljaGVzdHZvX3Nwb3NvYm92KGxvbmcgTikgewoJaWYgKE4gPCAzKSByZXR1cm4gMDsKCWlmIChOID09IDMpIHJldHVybiAxOwoJaW50IGEgPSBOIC8gMjsKCWludCBiID0gTiAtIGE7CglpZiAoYSA9PSBiKSByZXR1cm4gMiAqIGtvbGljaGVzdHZvX3Nwb3NvYm92KGEpOwoJcmV0dXJuIGtvbGljaGVzdHZvX3Nwb3NvYm92KGEpICsga29saWNoZXN0dm9fc3Bvc29ib3YoYik7Cn0KCmludCBtYWluKCkgewoKCXN0ZDo6Y291dCA8PCBrb2xpY2hlc3R2b19zcG9zb2JvdigyMTQ3NDgzNjQ3KTsKCQoJcmV0dXJuIDA7Cn0=