Many commands in NetHack can be preceded by a numeric prefix, which modifies the action taken. This usually involves repeating the command several times, or interacting with a specified number of items.
You can also use numbers to specify a certain number of items in some menus, such as when using the extended drop command or when applying a container. When the menu is visible, you can type a number followed by the menu letter (e.g. 20a) to manipulate only some of the items in the stack. You do not need to use n, even when number_pad is enabled.