#include <stdio.h>
#include <string.h>
char n[20];
int main()
{
scanf("%s",&n);
int ok=2,scs=strlen(n);
if((int)(n[scs-1]-'0')%2)ok=1;
if(scs%2==1&&ok==1)printf("1");
else if(scs%2==0&&ok==2)printf("0");
else printf("-1");
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdHJpbmcuaD4KY2hhciBuWzIwXTsKaW50IG1haW4oKQp7CiAgICBzY2FuZigiJXMiLCZuKTsKICAgIGludCBvaz0yLHNjcz1zdHJsZW4obik7CiAgICBpZigoaW50KShuW3Njcy0xXS0nMCcpJTIpb2s9MTsKICAgIGlmKHNjcyUyPT0xJiZvaz09MSlwcmludGYoIjEiKTsKICAgIGVsc2UgaWYoc2NzJTI9PTAmJm9rPT0yKXByaW50ZigiMCIpOwogICAgZWxzZSBwcmludGYoIi0xIik7Cn0K