Number of Front Page Nodes Variable?
This value can be set in the site information admin settings form. 

$count = variable_get('default_nodes_main', 10);


This should work for both Drupal 5, 6 and 7.