import java.util.*;
import java.lang.*;
import java.io.*;
class Main
{
{
Scanner scan
= new Scanner
(System.
in); double x0 = scan.nextDouble();
double y0 = scan.nextDouble();
double x1 = scan.nextDouble();
double y1 = scan.nextDouble();
double x2 = scan.nextDouble();
double y2 = scan.nextDouble();
double x3 = scan.nextDouble();
double y3 = scan.nextDouble();
double z1,z2,z3;
z1 = (x1 - x0) * (y2 - y1) - (x2 - x1) * (y1 - y0);
z2 = (x2 - x0) * (y3 - y2) - (x3 - x2) * (y2 - y0);
z3 = (x3 - x0) * (y1 - y3) - (x1 - x3) * (y3 - y0);
if ((z1
>=0 && z2
>=0 && z3
>=0) || (z1
<=0 && z2
<=0 && z3
<=0)) System.
out.
println("1"); }
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBNYWluCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCVNjYW5uZXIgc2NhbiA9IG5ldyBTY2FubmVyKFN5c3RlbS5pbik7CgkJZG91YmxlIHgwID0gc2Nhbi5uZXh0RG91YmxlKCk7CgkJZG91YmxlIHkwID0gc2Nhbi5uZXh0RG91YmxlKCk7CgkJZG91YmxlIHgxID0gc2Nhbi5uZXh0RG91YmxlKCk7CgkJZG91YmxlIHkxID0gc2Nhbi5uZXh0RG91YmxlKCk7CgkJZG91YmxlIHgyID0gc2Nhbi5uZXh0RG91YmxlKCk7CgkJZG91YmxlIHkyID0gc2Nhbi5uZXh0RG91YmxlKCk7CgkJZG91YmxlIHgzID0gc2Nhbi5uZXh0RG91YmxlKCk7CgkJZG91YmxlIHkzID0gc2Nhbi5uZXh0RG91YmxlKCk7CgkJZG91YmxlIHoxLHoyLHozOwoJCXoxID0gKHgxIC0geDApICogKHkyIC0geTEpIC0gKHgyIC0geDEpICogKHkxIC0geTApOwoJCXoyID0gKHgyIC0geDApICogKHkzIC0geTIpIC0gKHgzIC0geDIpICogKHkyIC0geTApOwoJCXozID0gKHgzIC0geDApICogKHkxIC0geTMpIC0gKHgxIC0geDMpICogKHkzIC0geTApOwoJCWlmICgoejE+PTAgJiYgejI+PTAgJiYgejM+PTApIHx8ICh6MTw9MCAmJiB6Mjw9MCAmJiB6Mzw9MCkpIFN5c3RlbS5vdXQucHJpbnRsbigiMSIpOwoJCWVsc2UgU3lzdGVtLm91dC5wcmludGxuKCIwIik7Cgl9Cn0=