```python
def slot_hits(keys: list[int], slots: int) -> int:
    if not isinstance(slots, int) or slots <= 0:
        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")

    cache = [-1] * slots
    hits = 0

    for key in keys:
        target_slot = key % slots
        if cache[target_slot] == key:
            hits += 1
        else:
            cache[target_slot] = key

    return hits
```