Slightly optimized problem 3.