Great advice from everyone. Just wanted to add a tip that can be useful for everyone with cats.
The tip is that you should have one litterbox per cat + one extra. I have two cats and three boxes.
This is a tip from experts and I don't remember the whole explanation right now, but some cats are more sensitive than others and it makes them feel better to have more choices.
So with one cat it's a good idea to have two litterboxes.
And yes, I did have a problem with one of my cats before I tried this, and it worked for me.