Make a column to count duplicates

How can I make a new column to count duplicates one by one without losing hte duplicated rows.

An example of the output I’m looking for is below

| Order Number | Rank |
| 5512         | 1    |
| 5512         | 2    |
| 5512         | 3    |
| 176          | 1    |
| 176          | 2    |
| 3098         | 1    |
| 831          | 1    |
| 831          | 2    |