Simple Answer:
In A1
=if(b1="","",row())
In A2
=if(b2="","",row())
copy this down the column. Each time an entry is entered in column B the next number in order will be entered in column A.
Suppose you want the answer of 2 in a4
cell because of your heading & other stuff,
you can write as
=if(b4="","",row()-2)