I think you are confused about what is a row and what is a column. I am also
not sure if you want all identical rows counted or only successive ones.
Try this
In H1 put =G1+2*F1+4*E1+8*D1+16*C1+32*B1+64*A1
In I1 put =COUNTIF($H$1:$H$50,H1)
Now select both those cells and copy them down all the rows to row 50.
If you want you can hide column H
Does this give you what you want?