Hi,
I'd say that both grades get counted for AMCAS, because w/ AMCAS you enter every single class on your transcript. So unless the university removes from your transcript the first time you took the class (which yours doesn't...) then it will be counted.