def calculate_width(count, parent_count, parent_width):
    """calculate_width(count: int, parent_count: int, parent_width: int)
    Calculate string width based on parent width and sample count.
    """
    return int(count * parent_width // parent_count) if parent_count != 0 else 0