#include using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; cout << int(a*c % (2 * b*d) == 0) << endl; return 0; }