Looks like I was just getting the page count in the wrong place. Here’s a working solution.
<?php $pagecount = 0;
while( has_sub_field("content") ) :
if(get_row_layout() == "page_break") :
if(get_sub_field('break_here')){
$pagecount++;
}
endif;
endwhile;
?>
Then I can just use $pagecount
elsewhere:
<?php echo $pagecount; ?>