Here is an example using 10 as the free shipping quantity:
<?php if($CartName->TotalColumn("Quantity") > 0 && $CartName->TotalColumn("Quantity") < 10) { ?>Add <?php echo(10-$CartName->TotalColumn("Quantity")); ?> more items to the cart for free shipping<?php } ?>