x=list(input())
t=sum(list(map(int,[x[i] for i in range(0,len(x),2)])))-sum(list(map(int,[x[i] for i in range(1,len(x),2)])))
print(abs(t))