def parse_time_hms(s):
    """Convert HH:MM:SS to seconds."""
    parts = [float(x) for x in s.split(":")]
    sec = 0
    for i, part in enumerate(reversed(parts)):
        sec += part * 60**i
    return sec