The right amount of sad

What’s the right thing to say when somebody tells you they’re sorry to hear that. 
Maybe you just broke up with your partner, one of your relatives died, or you’ve found out you have a serious illness. 
If you’re too sad, then it’s just awkward for the other person. It’s hard for them to console you, especially if they’re not a close friend. 
But if you’re not sad enough, they might think you’re a psychopath.
I struggle with the second one. I tend to be rational about things. It is what it is. 
But when people tell me they’re sorry to hear that, I feel pressure to act the appropriate amount of sad. 
So I end up sharing something like, “Yea, thanks, it’s tough.”
If I was responding honestly, I’d probably say, “Seriously, no worries, we’re moving past it.”