Microscopic derivation of the Bekenstein-Hawking entropy formula for non-extremal black holes