Try reversing the logic, put the dividing line before the post but only do it after the first post.
To answer your question though, you can get the loop count with the following:
global $wp_query;
$count = count( $wp_query->posts );
// or
$count = $wp_query->post_count;