ㄉㄨㄥˊshīzhī‑dōngyúㄕㄡㄙㄤˊshōuzhī‑sāngyú

失之东隅,收之桑榆
  1. 後漢書列傳》:谿可謂失之東隅,收之桑榆。」出處早晨日落晚上)​。比喻雖然一方損失失誤一方補償挽回 事業方面遭受失敗愛情方面美人可謂失之東隅,收之桑榆」。

to lose at sunrise but gain at sunset (idiom)​; to compensate later for one's earlier loss, what you lose on the swings you gain on the roundabouts