```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")
    
    hits = 0
    cache = [None] * slots
    
    for key in keys:
        if not isinstance(key, int):
            raise ValueError("All keys must be integers")
        
        slot_index = key % slots
        
        if cache[slot_index] == key:
            hits += 1
        else:
            cache[slot_index] = key
    
    return hits
```