Alternative content
I agree with Jit, but you also need to remember ... when working with large Fasta files, it’s common to discuss things in terms of megabytes or gigabytes, not millions or billions of bytes. This is another complication, since 1 megabyte = 1024 kilobytes = 1024 * 1024 bytes, whereas 1 megabase = 1000 kilobases = 1000 * 1000 base pairs.
Well, that is wrong way to estimate the genome size. There are extra characters in the file that do not represent nucleotides in the genome. Such as fasta header, newline char etc.
You can estimate it by counting fasta size of all sequences and sum them up.