import java.util.Scanner;
public class js {
public static void main(String[]argv) {
Scanner sc = new Scanner(System.in);
String s;
while(sc.hasNext()) {
s=sc.nextLine();
char[] Arr = s.toCharArray();
int A = 0;
int B = 0;
int total = 0;
for(int i=0;i<s.length();i++) {
if(i%2==0) {
A = A+Character.getNumericValue(Arr[i]);
}
else {
B = B+Character.getNumericValue(Arr[i]);
}
}
total=Math.abs(B-A);
System.out.println(total);
}
}
}