Brains and stock markets follow the same rules in crisis