Although your code should work, it’s Math.Roundincorrect, you can try the following:
int pages = (total + pageSize - 1)/pageSize;
It should be the same as Math.Ceiling, except that you always deal with int, and not doubleat any time, when it returns Math.Ceiling.
EDIT: To make your code work, you can try:
int pages = (int)Math.Ceiling((double)12/(double)5);
.