#include <stdio.h>

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

int main(void) {
	printf("%d\n", x("ba"));
	return 0;
}
