problem 67 (similar to 18)