How is compensation calculated for permanent or temporary disability?