The number of images in a series is not present in the dicom image file itself. This is auxiliary information, and the only way to obtain it is for someone to compute it after the fact and make it available to you.
This is often already done by the sender (with high certainty if it is a PACS) and can be made available to the receiver in a DICOM compliant manner via a Query / Retrieve request (keep reading to the end for details).
Contrary to what other answers have stated, dicom tag (0020, 0013) does not correspond to the number of instances within a series. Instead it identifies the instance within the series, and typically tracks the order in which the image was taken within that particular series.
As Brett stated in his answer, this is because it is effectively impossible for the creator of the file to truly know the final image count (due to all kinds of realities that can kick in) and so is not present in the file itself but needs to be determined after the fact.
The good news is that the sender should already have (and often will have if it is a PACS) done the counting for you, and will make this info available via DICOM tag "Number Of Series Related Instances (0020,1209)" via a Query / Retrieve.
There will also generally be a tag corresponding to number of series in the study, DICOM tag "Number of Study Related Series(0020,1206)."
To reiterate, these tags can often be obtained from a properly formed Query / Retrieve request to the sender, however they are not present in the image files themselves.