I found the formula as this:  but I can't cal the score correctly in the following figure: 