#!/bin/bash
netmask = '255.255.255.0'
result = ""
print netmask
for num in netmask.split('.'):
temp = str(bin(int(num)))[2:]
result = result + temp
print len("".join(str(result).split('0')[0:1]))
#!/bin/bash
netmask = '255.255.255.0'
result = ""
print netmask
for num in netmask.split('.'):
temp = str(bin(int(num)))[2:]
result = result + temp
print len("".join(str(result).split('0')[0:1]))