Largest subgraph from a hereditary property in a random graph