Charge response in 12C and 40Ca