#include <iostream>
using namespace std;
int main() {
double x0,x1,x2,x3,y0,y1,y2,y3;
double z1,z2,z3;
cin>>x0>>y0>>x1>>y1>>x2>>y2>>x3>>y3;
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)) cout<<"1";
else cout<<"0";
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwogCmludCBtYWluKCkgewoJZG91YmxlIHgwLHgxLHgyLHgzLHkwLHkxLHkyLHkzOwoJZG91YmxlIHoxLHoyLHozOwoJY2luPj54MD4+eTA+PngxPj55MT4+eDI+PnkyPj54Mz4+eTM7Cgl6MT0oeDEgLSB4MCkgKiAoeTIgLSB5MSkgLSAoeDIgLSB4MSkgKiAoeTEgLSB5MCk7CiAgICAgICAgICAgIHoyPSh4MiAtIHgwKSAqICh5MyAtIHkyKSAtICh4MyAtIHgyKSAqICh5MiAtIHkwKTsKICAgICAgICAgICAgejM9KHgzIC0geDApICogKHkxIC0geTMpIC0gKHgxIC0geDMpICogKHkzIC0geTApOwoJaWYgKCh6MT49MCAmJiB6Mj49MCAmJiB6Mz49MCkgfHwgKHoxPD0wICYmIHoyPD0wICYmIHozPD0wKSkgY291dDw8IjEiOwoJZWxzZSBjb3V0PDwiMCI7CglyZXR1cm4gMDsKfQ==