public function count(): int
    {
        $network_size = gmp_init($this->getNbAddresses());
        if (gmp_cmp($network_size, PHP_INT_MAX) > 0) {
            throw new \RuntimeException('The number of addresses is bigger than PHP_INT_MAX, use getNbAddresses() instead');
        }

        return gmp_intval($network_size);
    }