number = input().strip() # 去除前後多餘的空白或換行符
# 將輸入逐位轉換成數字列表
number = [int(digit) for digit in number if digit.isdigit()] # 只處理數字字符
oddsum = 0
evensum = 0
# 檢查奇數位和偶數位並分別計算它們的和
for i in range(0, len(number), 2):
oddsum += number[i]
for i in range(1, len(number), 2):
evensum += number[i]
# 計算奇數位和偶數位的絕對差值
print(abs(oddsum - evensum))