def count_failed_validations(sessions):
    """Count failed challenges from certbot logs"""

    failed_validations = 0
    
    for session in sessions:
        for line in session:
            if "'--staging'" in line:
                break
            if 'FailedChallenge' in line:
                failed_validations += 1

    return failed_validations