#include <bits/stdc++.h>
using namespace std;
#define ll long long
typedef vector<int> vi;
typedef pair <int, int> ii;
typedef pair <ll, int> li;
#define mk make_pair

struct point 
{
    double x, y;
};

point a, b, c, m;

double cc1(point a, point b)
{
    double a1 = max(a.x, b.x) - min(a.x, b.x);
    double b1 = max(a.y, b.y) - min(a.y, b.y);
    double ans = a1 * a1 + b1 * b1;
    return sqrt(ans);
}

double cc2(double a, double b, double c)
{
    double p = (double) (a + b + c) / 2.0;
    double ans = p * (p - a) * (p - b) * (p - c);
    return (ans > 0) ? sqrt(ans) : 0;
}


int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

    #define file "TAMGIAC"
    freopen(file".INP", "r", stdin);
    freopen(file".OUT", "w", stdout);

    cin >> a.x >> a.y;
    cin >> b.x >> b.y;
    cin >> c.x >> c.y;
    cin >> m.x >> m.y;
    
    //tinh canh
    double ab = cc1(a, b);
    double ac = cc1(a, c);
    double bc = cc1(b, c);
    double ma = cc1(m, a);
    double mb = cc1(m, b);
    double mc = cc1(m, c);

    // tinh dien tich

    double sabc = cc2(ab, ac, bc);
    double smab = cc2(ab, ma, mb);
    double smac = cc2(ac, ma, mc);
    double smbc = cc2(bc, mb, mc);

    cout << (abs((smab + smac + smbc) - sabc) <= 1e-4);
    

    return 0;
}