Calculate flex