A device for counting the number of medicines in a medicine packaging envelope the device includes: an illumination part which is configured to irradiate near infrared rays toward a sheet surface of the medicine packaging envelope an imaging part which is arranged at a position where the near infrared rays which pass through the medicine packaging envelope are received, and is configured to image the medicine packaging envelope and a medicine counting unit which is configured to count the number of medicines based on a gray image from the imaging part, wherein the imaging part includes a visible light cut filter in a light receiving part thereof, and the visible light cut filter is configured to prevent a reflection light which is formed by the reflection of the visible light on the medicine packaging envelope from being incident on the imaging part.