Quantifying team chemistry in scientific collaboration