how to solve integer overflow - Search