<?php $query = new WP_Query( array(
'post_type' => 'service', // name of post type.
'posts_per_page' => -1
) ); ?>
<?php
$programm_posts = get_field('programm_posts');
if( $programm_posts ): ?>
<?php foreach( $programm_posts as $post ):
setup_postdata($post); ?>
<?php
$children = get_children( array(
'post_parent' => $post->ID,
'post_type' => 'service',
) );
echo count($children);
?>
<?php endforeach; ?>
<?php wp_reset_postdata(); ?>
<?php endif; ?>