#include <bits/stdc++.h>using namespace std;
int main(){ string x; while (cin >> x){ int ans=0, sign=1; for (int i=0; i<x.size(); i++){ ans+=(x[i]-'0')*sign; sign*=-1; } cout << abs(ans) <<endl; }}