#include <iostream>
using namespace std;
int main(void)
{
int x, y;
cin >> x >> y;
if (x > 0)
{
if (y > 0)
cout << 1;
else
cout << 4;
}
else
{
if (y > 0)
cout << 2;
else
cout << 3;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKHZvaWQpCnsKICAgIGludCB4LCB5OwogICAgY2luID4+IHggPj4geTsKCiAgICBpZiAoeCA+IDApCiAgICB7CiAgICAgICAgaWYgKHkgPiAwKQogICAgICAgICAgICBjb3V0IDw8IDE7CiAgICAgICAgZWxzZQogICAgICAgICAgICBjb3V0IDw8IDQ7CiAgICB9CiAgICBlbHNlCiAgICB7CiAgICAgICAgaWYgKHkgPiAwKQogICAgICAgICAgICBjb3V0IDw8IDI7CiAgICAgICAgZWxzZQogICAgICAgICAgICBjb3V0IDw8IDM7CiAgICB9CiAgICByZXR1cm4gMDsKfQ==