begin get pagecount