def get_frame_number(frame):
    """Get frame number by calculating distance to newest frame."""
    
    num = 0
    newer = frame.newer()
    while newer != None:
        newer = newer.newer()
        num += 1
    return num