get next integer from input into *pn