how to find smallest integer