2025-06-29 21:03:41 +09:00

17 lines
334 B
Python

isbn = input()
acc = 0
isOdd = False
for n in isbn[:12] :
isOdd = not isOdd
if n != '*' :
if isOdd :
acc += int(n)
else :
acc += 3*int(n)
else :
weight = 1 if isOdd else 3
for i in range(10) :
if (i*weight + acc + int(isbn[12]))%10 == 0 :
print(i)
break