```python
"""Count the hits a key stream scores on a direct-mapped cache."""

def slot_hits(keys: list, slots: int) -> int:
    if not isinstance(slots, int) or slots < 1:
        raise ValueError("Slot count must be a positive integer")
    for key in keys:
        if not isinstance(key, int):
            raise ValueError("All keys must be integers")
    held = [None] * slots
    hits = 0
    for key in keys:
        slot_index = key % slots
        if held[slot_index] == key:
            hits += 1
        else:
            held[slot_index] = key
    return hits
```