#include <iostream>
using namespace std;
int main ()
{
double x;
cin>>x;
double y;
cin>>y;
cout<<((x==0)||(y==0)?"0":(x>0?
(y>0?"1":"4"):(y>0?"2":"3")));
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgbWFpbiAoKQp7CiAgICBkb3VibGUgeDsKICAgIGNpbj4+eDsKICAgIGRvdWJsZSB5OwogICAgY2luPj55OwogICAgY291dDw8KCh4PT0wKXx8KHk9PTApPyIwIjooeD4wPwogICAgKHk+MD8iMSI6IjQiKTooeT4wPyIyIjoiMyIpKSk7CiAJcmV0dXJuIDA7Cn0=