ויהי אחרי המגפה וגו'. מָשָׁל לְרוֹעֶה שֶׁנִּכְנְסוּ זְאֵבִים לְתוֹךְ עֶדְרוֹ וְהָרְגוּ בָהֶן וְהוּא מוֹנֶה אוֹתָן לֵידַע מִנְיַן הַנּוֹתָרוֹת; דָּבָר אַחֵר — כְּשֶׁיָּצְאוּ מִמִּצְרַיִם וְנִמְסְרוּ לְמֹשֶׁה נִמְסְרוּ לוֹ בְּמִנְיָן, עַכְשָׁו שֶׁקָּרַב לָמוּת וּלְהַחֲזִיר צֹאנוֹ מַחֲזִירָן בְּמִנְיָן (תנחומא): ויהי אחרי המגפה AND IT CAME TO PASS AFTER THE PESTILENCE [THAT THE LORD SPOKE TO MOSES … TAKE THE SUM OF ALL THE CONGREGATION] — A parable! This may be compared to the case of a shepherd amongst whose flock wolves found their way and slew some of them, and he counted them to discover the number of those that were left. — Another explanation: When they left Egypt and were entrusted to Moses' care, they were entrusted to him by number, now when he is close to death and has to hand back his sheep, he hands them back by number (Midrash Tanchuma, Pinchas 4).