While there are many, each time you call pinput you can only input a maximum of 16 items. Thus you need to specify an off set for the d(*) array [i.e., d(16) starts reading into the postion d(16), d(17),...]
Read the programmer manual for more information.