#include #include char s[55]; int main(){ scanf("%s",s+1); int n = strlen(s+1); int mod2 = 0, mod4 = 0; for(int i = 1; i <= n; i++){ int u = s[i]-'0'; mod2 = (mod2*10+u)%2; mod4 = (mod4*10+u)%4; } if(n==1 && s[1]=='1') printf("1\n"); else if(mod2!=0 || mod4==0) printf("1\n"); else printf("-1\n"); return 0; }