a = list(map(int,input().split())) count = 0 for i in a: j = int(i) if j % 3 == 0: count += 4 if j % 5 == 0: count += 4 if j % 3 != 0 and j % 5 != 0: count += len(i) print(count)