The shutter count is the number of photos a camera has taken. In the Nikon D40, this information is not available anywhere in the camera GUI. Instead, this information is written down in the EXIF information of the generated JPEG photo files.
To obtain the shutter count, open the most recent JPEG photo taken with the D40. Examine the EXIF information of the file, which can be done on the desktop or at the commandline. Look for the tag named Total Number of Pictures Taken in the Maker Note section. This number is your count.