#include <iostream>
template<unsigned int n> struct Count { bool data[n]; };
template<int n> struct Counter : public Counter<n-1> {};
template<> struct Counter<0> {};
Count<1> GetCount(Counter<1>);
#define MAX_COUNTER_NUM 64
#define COUNTER_VALUE (sizeof(GetCount(Counter<MAX_COUNTER_NUM + 1>())) / sizeof(bool))
#define INC_COUNTER Count<COUNTER_VALUE + 1> GetCount(Counter<COUNTER_VALUE + 1>);
int main()
{
std::cout << "counter = " << COUNTER_VALUE << "\n";
INC_COUNTER
std::cout << "counter = " << COUNTER_VALUE << "\n";
INC_COUNTER
std::cout << "counter = " << COUNTER_VALUE << "\n";
INC_COUNTER
std::cout << "counter = " << COUNTER_VALUE << "\n";
INC_COUNTER
std::cout << "counter = " << COUNTER_VALUE << "\n";
INC_COUNTER
std::cout << "counter = " << COUNTER_VALUE << "\n";
}
I2luY2x1ZGUgPGlvc3RyZWFtPgogICAgdGVtcGxhdGU8dW5zaWduZWQgaW50IG4+IHN0cnVjdCBDb3VudCB7IGJvb2wgZGF0YVtuXTsgfTsKICAgIHRlbXBsYXRlPGludCBuPiBzdHJ1Y3QgQ291bnRlciA6IHB1YmxpYyBDb3VudGVyPG4tMT4ge307CiAgICB0ZW1wbGF0ZTw+IHN0cnVjdCBDb3VudGVyPDA+IHt9OwogICAgQ291bnQ8MT4gR2V0Q291bnQoQ291bnRlcjwxPik7CiAgICAKICAgICNkZWZpbmUgTUFYX0NPVU5URVJfTlVNIDY0CiAgICAjZGVmaW5lIENPVU5URVJfVkFMVUUgKHNpemVvZihHZXRDb3VudChDb3VudGVyPE1BWF9DT1VOVEVSX05VTSArIDE+KCkpKSAvIHNpemVvZihib29sKSkKICAgICNkZWZpbmUgSU5DX0NPVU5URVIgQ291bnQ8Q09VTlRFUl9WQUxVRSArIDE+IEdldENvdW50KENvdW50ZXI8Q09VTlRFUl9WQUxVRSArIDE+KTsKCmludCBtYWluKCkKewoJc3RkOjpjb3V0IDw8ICJjb3VudGVyID0gIiA8PCBDT1VOVEVSX1ZBT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