Profiting from panic: inside the mind of a contrarian investor