Sum rules for quantum billiards