The math behind lost love and heartbreaks