First pass at grade-school solution.