//StudybarCommentBegin
#include <iostream>
#include <cmath>
using namespace std;
class Point
{
protected:
    double x, y;
public:
    Point(double x = 0, double y = 0)
    {
        this->x = x; this->y = y;
    }
    void SetPoint(double x = 0, double y = 0)
    {
        this->x = x; this->y = y;
    }
    double GetX() const { return x; }
    double GetY() const { return y; }
    void Move(double xOff, double yOff)
    {
        x += xOff; y += yOff;
    }
    double Dist(Point const &p) const {
        double tmpx = x - p.x;
        double tmpy = y - p.y;
        return  ::sqrt(tmpx*tmpx + tmpy*tmpy);
    }
};

class Rectangle : public Point
{
public:
    void SetRect(double x, double y, double w, double h)
    {
        SetPoint(x, y); this->w = w; this->h = h;
    }
    double GetW() const { return w; }
    double GetH() const { return h; }
    double DistOfTwoR(const Rectangle &R) {
        return  this->Dist(R);
    }
protected:
    double w, h;
};
//StudybarCommentEnd

class RectWithAngle : public Rectangle
{
protected:
    double ang;
public:
    RectWithAngle(double x, double y, double w, double h, double angle)
    {
        Rectangle::SetRect(x, y, w, h);
        this->ang = angle;
    }

    int IsPointInMe(Point p) const
    {
        p.Move(-x, -(y+h));
        double s = ::sin(-ang);
        double c = ::cos(-ang);
        double x = (p.GetX()*c - p.GetY()*s);
        double y = (p.GetX()*s + p.GetY()*c) + h;

        if (x >= 0 && y <= 0 && x <= w && y >= -h)
            return 1;
        return 0;
    }
};

//StudybarCommentBegin
int main()
{
    double angle;
    double x, y;
    cin >> angle;
    cin >> x >> y;
    RectWithAngle  R1(0, 0, 8.5, 5, angle);
    R1.Move(2, 2);
    Point p;
    p.SetPoint(x, y);
    cout << R1.IsPointInMe(p);
    return 0;
}
//StudybarCommentEnd