Calculate the occurrence of motif in sequences (including overlaps) using Python
This is a good task for Biopython:

from Bio import SeqIO

with open('input_file') as f:
    motif = next(f).rstrip().lower()
    for r in SeqIO.parse(f, 'fasta'):
        print(r.id, ':', r.seq.lower().count_overlap(motif))


Note: in future I would recommend don't add the motif to the start of your FASTA file, keep it separate so as not to alter the standard file format.