Place the pumpkin in a baking pan with the skin upwards. Pour in 2-3cm water, cover with foil and bake 30-40 minutes or until soft.
Meanwhile, boil the potatoes and sweet potatoes until soft (or use a pressure cooker).
Scoop the pumpkin flesh out of the skins into a large saucepan. Drain the potatoes, let cool slightly and peel. Add to the saucepan with the stock and sage. Bring to the boil, reduce heat and simmer 20 minutes. Remove sage, puree soup with a stick blender and simmer 10 more minutes. Season with salt and pepper.
Pour the soup into 4 bowls and garnish each with a drizzle of olive oil, 1 tablespoon grated pecorino and 1 tablespoon ham. Serve with toast.