To calculate the number of hosts, examine the third and fourth octet. After borrowing 7 bits for the subnet, there is one host bit remaining in the third octet and there are 8 host bits remaining in the fourth octet.
Apply the host calculation formula as shown in Figure 1.
2^9 = 512
But remember that all 0 bits in the host portion of the address is the network address, and all 1s in the host portion is a broadcast address. Therefore, there are only 510 host addresses that are actually available for each subnet.
As showing in Figure 2, the first host address for the first subnet is 172.16.0.1 and the last host address is 172.16.1.254. Remember that each host must have a valid IP address within the range defined for that network segment. The subnet assigned to the router interface will determine which segment a host belongs to.
Bits can only be borrowed from the host portion of the address. The network portion of the address is allocated by the service provider and cannot be changed. So organizations that required a significant number of subnets were required to communicate this need to their ISP so that the ISP would allocate an IP address with a default mask with enough bits to create the needed subnets.