Use this code if you’re in the loop:
$attachments = get_children( array( 'post_parent' => $post->ID ) );
$count = count( $attachments );
If you’re not in the loop, substitute $post->ID
with the ID of the specific post. But that should count all attachments.