#include <stdio.h>

//t;x(char*s){*s&1&&(t+=2);return--t?*s&&x(s+1):*s&&!1[s];}

t;x(char*s){t+=*s%2*2;return--t?*s&&x(s+1):*s*!1[s];}


int main(void) {
	char text[100];
	while ( scanf("%s", text) != EOF ) {
		t^=t;
		printf("%d\n", x(text));
		
	}
	return 0;
}
