Trying to explain the unexplainable from the far reaches of the mind.
Yes. It counts. The right thing is still the right thing. It may not matter to the one doing it, but it will still have a positive affect on the recipient of the "rightness". The goodness shown to another, even if it is without motivation, is still goodness. Rarely is the right thing of benefit to the one doing it. The point is that it is right. The fact that makes it right is higher than you. You do it for the one establishing that higher right. You don't do it for yourself. But does it count. Yes. It counts. It most certainly counts. It is the right thing.
Clearly you are driven from your heart. I only wish I could say the same.