Calculating the 30 days?

Hi, I’m visa exempt for 30 days. How to calculate this? Say I enter Taiwan July 2nd, I should leave by the 29th of July as my latest? That seems to be the 29th day of the visa exempt counting the first day I entered. Or can I leave on the 30th?

30 days including the day you landed

As said, 30 days, including the day you landed. If you land July 2, you can leave July 31 but no later.