<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def alt40fms(msg):
 """Selected altitude, FMS Args: msg (String):
 28 bytes hexadecimal message (BDS40) string Returns: int: altitude in feet """

    d = hex2bin(data(msg))

    if d[13] == '0':
        return None

    alt = bin2int(d[14:26]) * 16    # ft
    return alt