import gzip

file = gzip.open("UP000000798.swiss.gz", 'rt')

total=0
helix = 0
trans = 0
catalac = 0

h = True
t = True
c = True
for line in file:
    if line.startswith("FT"):
        if "TRANSMEM" in line and t== True:
           trans+=1
           t=False
        if "HELIX" in line and h== True:
            helix+=1
            h=False
    if line.startswith("CC") or line.startswith("DE"):
        if ("CATALYTIC ACTIVITY" in line or "EC=" in line) and c==True:
            catalac+=1
            c=False
    if line.startswith('//'):
        c=True
        t=True
        h=True
print(trans, helix, catalac)
       

