def CalculateHalogenNumber(mol):
    """
    Calculation of Halogen counts in a molecule
        Parameters:
            mol: rdkit molecule
        Returns:
            HalogenNumber
    """
    i = 0
    for atom in mol.GetAtoms():
        if atom.GetAtomicNum() == 9 or atom.GetAtomicNum() == 17 or atom.GetAtomicNum() == 35 or atom.GetAtomicNum() == 53:
            i = i + 1
    return i