def extract_electrostatics(pdb_file):
    """
    Extracts the electrostatics energy from a HADDOCK PDB file.

    :param pdb_file: The input PDB file.
    :return: Electrostatics energy
    """
    electrostatics = None
    for line in pdb_file:
        # scan for Haddock energies line and assign electrostatics
        if line.startswith('REMARK energies'):
            line = line.rstrip()
            line = line.replace('REMARK energies: ', '')
            electrostatics = float(line.split(',')[6])
            break
        # stop on first ATOM Line as remarks should be beforehand
        elif line.startswith('ATOM'):
            break
    # try to reset file handle for further processing
    try:
        pdb_file.seek(0)
    except Exception:
        pass
    return electrostatics