map
lst = list(map(int,input().split(' '))) def func(x): return x*x answer = sum(map(func,lst)) % 10 print(answer)