#include<bits/stdc++.h>
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma comment(linker, "/stack:200000000")
using namespace std;
int main()
{
ios::sync_with_stdio(0);
while(true)
{
int_fast64_t b=0;
char a[1001];
cin>>a;
for(int_fast8_t i=0;a[i]!='\0';i++)
{
b=b+(a[i]-'0');
i++;
if(a[i]=='\0')
break;
b=b-(a[i]-'0');
}
if(b<0)
cout<<-b;
else
cout<<b;
}
return 0;
}