computes CIDR from netmask string