Word Problem Cost minimization