How to count other posts not having specific taxonomy terms?

There is not a NAND operator for the tax_query of WP_Query. If I understood correctly, what you intend can be rewritten this way:

  1. Get all the posts without the term c.
  2. Get all the posts without the term java.
  3. Exclude the posts having both the terms c and java.

To achieve that, you can combine two NOT IN queries and match them with an OR:

$args = array(
    'post_type' => 'book',
    'tax_query' => array(
        'relation' => 'OR',
        array(
            'taxonomy' => 'language',
            'field'    => 'slug',
            'terms'    => array( 'c' ),
            'operator' => 'NOT IN',
        ),
        array(
            'taxonomy' => 'language',
            'field'    => 'slug',
            'terms'    => array( 'java' ),
            'operator' => 'NOT IN',
        ),
    )            
);

$posts = get_posts( $args );

echo count( $posts );