Using a query could give you easier customization without having to use SQL directly.
$posts = get_posts( array(
'post_type' => 'post',
'post_status' => 'any',
'numberposts' => -1,
'fields' => 'ids',
));
$total_count = count( $posts );
print_r ( $total_count );