Easy problem, cool math.