Chaotic dynamics in the Friedmann equation