from collections import defaultdict
d=defaultdict(int)
st='A'
cnt=1

# assigning the value of each alphabet 

for i in range(26):
    d[st]=cnt
    st=chr(ord(st)+1)    # incrementing the alphabet
    cnt+=1 

l=[(i*(i+1))//2 for i in range(1,100)]  # Triangle numbers


with open(r'name.txt','r') as f:#for open file in read mode
    data=f.read().split(',')    #reading file seperated by comma

cnt=0

for i in data:  # for extracting every word from list
    summ=0   
    for j in i:
        summ+=d[j]  # storing the sum of character value of name
    if summ in l:   # if summ is triangle number
        cnt+=1

print(cnt)

36bcc2d3b52fef902d010437f9babf661ad39043
<mask token>

<mask token>
for i in range(26):
    d[st] = cnt
    st = chr(ord(st) + 1)
    cnt += 1
<mask token>
with open('name.txt', 'r') as f:
    data = f.read().split(',')
<mask token>
for i in data:
    summ = 0
    for j in i:
        summ += d[j]
    if summ in l:
        cnt += 1
print(cnt)

<mask token>
d = defaultdict(int)
st = 'A'
cnt = 1
for i in range(26):
    d[st] = cnt
    st = chr(ord(st) + 1)
    cnt += 1
l = [(i * (i + 1) // 2) for i in range(1, 100)]
with open('name.txt', 'r') as f:
    data = f.read().split(',')
cnt = 0
for i in data:
    summ = 0
    for j in i:
        summ += d[j]
    if summ in l:
        cnt += 1
print(cnt)

from collections import defaultdict
d = defaultdict(int)
st = 'A'
cnt = 1
for i in range(26):
    d[st] = cnt
    st = chr(ord(st) + 1)
    cnt += 1
l = [(i * (i + 1) // 2) for i in range(1, 100)]
with open('name.txt', 'r') as f:
    data = f.read().split(',')
cnt = 0
for i in data:
    summ = 0
    for j in i:
        summ += d[j]
    if summ in l:
        cnt += 1
print(cnt)

from collections import defaultdict
d=defaultdict(int)
st='A'
cnt=1

# assigning the value of each alphabet 

for i in range(26):
    d[st]=cnt
    st=chr(ord(st)+1)    # incrementing the alphabet
    cnt+=1 

l=[(i*(i+1))//2 for i in range(1,100)]  # Triangle numbers


with open(r'name.txt','r') as f:#for open file in read mode
    data=f.read().split(',')    #reading file seperated by comma

cnt=0

for i in data:  # for extracting every word from list
    summ=0   
    for j in i:
        summ+=d[j]  # storing the sum of character value of name
    if summ in l:   # if summ is triangle number
        cnt+=1

print(cnt)
