Automatic calculate total_tp