Olympics: What is the correct way to count medals?

In Germany they have always counted “most gold medals” then as the next tie breaker “most silver medals” etc. In this scenario China has been ahead of the US all along.