arch_init: Count the total number of pages by using helper function