塞翁失馬,焉知非福?
塞翁is name of an old man; 失 is to lose; 焉知非福 means its hard to know if its a blessing.
There is a story behind. An old man was living his life by raising very nice horses. One day one of his horses got into the territory of the northern tribes. Everyone commiserated with him. But he thought perhaps this would soon turn out to be a blessing.
Few months later, his animal came back leading a fine horse from the north. Everyone congratulated him. But he thought perhaps this would soon turn out to be a cause of misfortune.
Soon his son broke his thigh bone falling from that horse. But he was still thinking perhaps itd turn out a blessing again.
One year later the northern tribes started a big invasion. All young men were drafted and nine out of ten men died. The man's son was not accepted in the army because he was crippled and so both the son and his father survived.
It tells us when something bad happens, perhaps its blessing for something bad waiting ahead.
Thats derived from a special part of Chinese philosophy--中庸--not too much, not too little, just in the middle.