Response time of glaciers as a function of size and mass balance: 1. Theory