Hello,
Assuming your data starts in A1, in B1 enter the following formula
=COUNTIF($A$1:A1,A1)
and copy down column B as far as column A goes.
Then select columns A and B and sort by Column B first, then by Column A.
This works for the data supplied.