Use get_term_children()
$term_id = 2; // use get_queried_object()->term_id; to get the current term id
$taxonomy_name = \'mypages\'; // use use get_queried_object()->taxonomy; to get the current taxonomy name
$countchildren = count (get_term_children( $term_id, $taxonomy_name ));
echo $countchildren;