X=input()[::-1]oddsum=0evensum=0for i in range(1,len(X)+1,2): oddsum += int(X[i-1])for i in range(2,len(X)+1,2): evensum += int(X[i-1])print(abs(oddsum-evensum))