Thermodynamics of two black holes