import shutil


def get_disk_free_capacity(path):
    """Estimate number of free pictures slots in disk space."""
    total, used, free = shutil.disk_usage(path)
    mib = 1000 * 1000
    free -= 50 * mib
    if free <= 0:
        free = 0
    free /= 5 * mib  # how many 5MiB pics fit into the remaining space?
    return int(free)