I want to count the number of similar cells with a rolling number, for example:

abc 1
abc 2
abc 3
xyz 1
xyz 2
aaa 1
aaa 2
aaa 3
aaa 4

First column is my data. Second column would be how many times that value shows on a counting basis. How do I get the numbers in the 2nd column? I know its some sort of countif statement but I can get it to work.

I was thinking something like =countif(A1:A9,A1=A2) or something along those lines but I just can't quite get it right. Any help, I couldn't find this exact circumstance by searching here.