```python
def slot_hits(keys: list[int], slots: int) -> int:
    if not isinstance(slots, int) or slots <= 0:
        raise ValueError("Invalid slot count; must be a positive integer")
    if any(not isinstance(key, int) for key in keys):
        raise ValueError("All keys must be integers")

    cache = [None] * 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
```