def ip_to_num(ip):
    """
    Convert an IP string to a number value.
    :param ip: IP string to convert
    :return: A number representation of the IP address
    """
    s = ip[0].split(".")
    return int(s[0]) << 24 | int(s[1]) << 16 | int(s[2]) << 8 | int(s[3])