HEAT THE OIL IN A LARGE saucepan over medium heat. Add the onion, carrot, celery, garlic and ham and saute, stirring frequently, for 5 minutes. Add the beans, rosemary, chicken stock and pepper, and bring to a boil. Simmer, covered, for 30 minutes. Taste the cooking liquid, and add enough salt so that it becomes slightly salty (the amount needed will vary depending on the type of ham used for seasoning). Recover the pot and simmer for 40 to 60 minutes, or until the beans are soft. Puree the mixture in a food processor fitted with the steel blade or in a blender. Serve hot. Serves 6 to 8. The soup can be made up to three days in advance and refrigerated, covered.