Problem 7 Russian Version