calculate response length