When models manipulate manifolds: The geometry of a counting task