Wild chimpanzees seek out medicinal plants to eat when they are sick or injured, a study says.