Characteristics of affected third parties and cooperative behavior in social dilemmas