How long to keep my iphone in rice?

I dropped my phone in water. I didn't really know what to do so I hair dryed it. It worked for a bit but then flickered off. Everything else was still on, like my alarm still went off and I was still receiving messages, it was just like my screen was on forever hold. I didn't have rice so about 15 hours later I put it in rice. After 2 hours my phone seems to be working perfectly again, however I put it back in the rice shut off anyways.
How long should I aprrox leave it in there?

I really don't care if you do not believe in the rice method, so do not comment just to let me know that.

3 to 5 days. If you notice that the rice is getting moist, get fresh rice and a new bag.