def count_sdf_mols(file_path):
    """
    This function returns the number of molecules in an sdf-file.

    Parameters
    ----------
    file_path : str
        Full path to sdf file.

    Returns
    -------
    counter : int
        Number of molecules.

    """
    print('Counting molecules in {}...'.format(file_path))
    counter = 0
    with open(file_path, 'r', errors='backslashreplace') as sdf_file:
        for line in sdf_file:
            if '$$$$' in line:
                counter += 1
    return counter