{ Free Pascal }

var f: text;
var a, b, n, m, ans: longint;
begin
    assign(f, 'comics.in');
    reset(f);
    read(f, a, b, n, m);
    close(f);

    if a * n + b * m > a * m + b * n then
        ans := 1
    else if a * n + b * m < a * m + b * n then
        ans := 2
    else
        ans := 0;

    assign(f, 'comics.out');
    rewrite(f);
    writeln(f, ans);
    close(f);
end.