AWS Storage Cost for a custom AMI How does AWS calculate the cost of a custom AMI?

If I would create an AMI which is based on Ubuntu 16.04, do I need to pay for the complete size of AMI (e.g. 4GB) or just the differences of my custom AMI to the base AMI (e.g. 0.4GB)
AWS stores whole AMI as a single non-differential snapshot thus they charge for a full size of files in an image.