Whenever there is a Potential difference, there would be a flow if there is a conductor in place (like your case, where metal objects are in touch) The flow will continue until the potential difference does not exist any more. This is like water always flowing from a higher to lower altitude if it can. So across a metal, you will always have the same potential. Based on that you can calculate the charge for them. It means, the charge in each sphere should be as much that the Potential on the surface (where they are in contact) would be equal for both objects. You also know the total charge in the system.