diff --git a/js/reveal.js b/js/reveal.js
index 4f44c5f743509a50747ab9348806f3cb6210fdb3..46b92b557dbf651776fdf2564470365082b7e91b 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -2793,7 +2793,7 @@
 		var horizontalSlides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) );
 
 		// The number of past and total slides
-		var totalCount = dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ':not(.stack)' ).length;
+		var totalCount = getTotalSlides();
 		var pastCount = 0;
 
 		// Step through all slides and count the past ones