def count_unique_peaks(peaks):
    """Returns the number of unique peaks."""
    n_unique = 0
    for chrom in peaks.chroms:
        for peak in peaks.fetch(chrom):
            if not peak.iscommon:
                n_unique += 1
    return n_unique