Good health (losing it teaches you this).
Ignoring people who want/insist that you be "like everyone else". E.g. living in a noisy dorm, studying in the library at a table full of chatters, working in an open floor of cubicles.
Be yourself. In the long run, you'll gain more acceptance that way, anyway. And you'll be able to effectively work.
And the long hours come naturally, when you're doing something that interests you. Note that, not infrequently, that interest will have more of a social context -- and motivation -- than you might expect. Just, approach that context on your own terms.