#include using namespace std; int main() { int x, y, x2, y2; cin >> x >> y; int ans = -1; if (x == y) { ans = 0; } else if (x == 0) { ans = 2; } else if (y == 0) { ans = 1; } cout << ans << endl; return 0; }