Why does my iPhone say I don't have enough storage to buy this app?

I tried to download the app iMovie. According to iTunes, it takes up 519.3 MB. My phone has 522 MB available, but when I sync my phone it still won't download. It says I don't have enough space.

It needs to leave a few MB's spare for inter -netting and calls and all of your basics to run the apps-but the only solution is to delete apps you don't use!