Solution for problem 22 (name score)