Extended Phi value to have more proper result in Problem 25