calculate page