Ensure to return 0 if no valid/invalid shares are found