def read():
    with open("C:/Users/User22/Downloads/GCF_013402875.1_ASM1340287v1_genomic.fna", "r") as fa:
        print(fa.readline().strip())
        a, g, al, c, t = 0, 0, 0, 0, 0
        for i in fa:
            i = i.strip()
            if i.startswith(">"):
                a = a / al
                g = g / al
                c = c / al
                t = t / al
                print(f"A: {a:.4f}, G: {g:.4f}, C: {c:.4f}, T: {t:.4f} length: {al}, AGGAGG: {a * g * g * a * g * g * al:.4f}, CCTCCT: {c * c * t * c * c * t * al:.4f}")
                a, g, al = 0, 0, 0
                print(i)                
            else:
                i = i.upper()
                g += i.count("G")
                a += i.count("A")
                c += i.count("C")
                t += i.count("T")
                al += len(i)
            yield a, g, c, t, al
a = read()
while True:
    try:
        b = next(a)
    except:
        print("Too lazy to process the last plasmid")
        break

strand = input()
with open("C:/Users/User22/Downloads/GCF_013402875.1_ASM1340287v1_feature_table.txt", "r") as ft:
    ft.readline()
    if strand == "+":
        cds = (i.split(sep="\t")[7] for i in ft if (i.split(sep="\t")[0] == "CDS" and i.split(sep="\t")[9] == strand and i.split(sep="\t")[4] == "chromosome"))
        coords = ((int(j) - 20, int(j) - 8) for j in cds)
    else:
        cds = (i.split(sep="\t")[8] for i in ft if (i.split(sep="\t")[0] == "CDS" and i.split(sep="\t")[9] == strand and i.split(sep="\t")[4] == "chromosome"))
        coords = ((int(j) + 8, int(j) + 20) for j in cds)
    coo = list(coords)
with open("C:/Users/User22/Downloads/sd_cmpl.fuzznuc", "r") as res:
    c = 0
    for _ in range(25):
        res.readline()
    for i in res:
        try:
            if i.split()[2] == strand:
                i = int(i.strip().split()[0])
                for j in coo:
                    if i > j[0] and i < j[1]:
                        print(i)
                        c += 1
        except:
            if i.startswith("#"):
                break
print(c)