which agreement solved the disagreement over whether slaves should be counted for the purposes of representation
The agreement that solved the disagreement over whether slaves should be counted for the purpose of representation was the Three-Fifths Compromise. This compromise was reached between the Southern and Northern states in 1787.
The Compromise that was reached was the 3/5ths compromise which satisfied both the North and the South because The effect was to give the southern states a third more seats in Congress and a third more electoral votes than if slaves had been ignored, but fewer than if slaves and free persons had been counted equally