ABC까지 3초 걸리므로 times 배열의 인덱스 3에 저장한다. 남은 알파벳들도 걸리는 시간이 인덱스 값과 같도록 배열에 초기화해준다.
반복문을 통해 비교해주며 인덱스의 값을 더해준다.
import sys
input = sys.stdin.readline
word = input()
times = ['-','-','-','ABC','DEF','GHI','JKL','MNO','PQRS','TUV','WXYZ']
cnt = 0
for i in word :
for time in times:
if i in time :
cnt += times.index(time)
print(cnt)