Function to calculate the cidr from a netmask