import std.stdio; import core.bitop; void main() { uint x; readf("%s", &x); const uint N = 2<<31 - 1; uint c = 0; ulong sum = 0; for (uint i = 0; i <= N; i++) { if (x != i.popcnt) { continue; } c++; sum += i; } writef("%d %d\n", c, sum); }