#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;

int main() {
    int x, y;
    cin >> x >> y;

    int k = 0;
    if (x != y) {
        if (x == -y) {
            k = 3;
        } else {
            int t = x; x = x + y; y = t - y;
            if (x == y) k = 1; else if (x == -y) k = 2; else k = -1;
        }
    }

    cout << k << endl;

    return 0;
}