Its the same concept as working out a subnet.