#include #include #include using namespace std; //namaega184 int main(){ int d;int h[3];scanf("%d",&d);for(int i=0;i<3;i++)scanf("%d",&h[i]); bool f[3]; f[0]=h[0]!=h[1],f[1]=h[1]!=h[2],f[2]=h[2]!=h[0]; if(f[0]&&f[1]&&f[2])puts("0"); else if(!f[0]&&!f[1]&&!f[0]){ if(h[0]>=d*2)puts("2"); else puts("-1"); } else{ for(int i=0;i<3;i++){ if(!f[i]){ if(h[i]>=d){ if(h[i]-d==h[(i+2)%3]){ if(h[i]>=d*2)puts("2"); else puts("-1"); } else puts("1"); } } } } //printf("%d\n",-1000); return 0; }