#include <bits/stdc++.h>
using namespace std;

const float eps = 0.00001f;

float povrsinaTrougla(int x1, int y1, int x2, int y2, int x3, int y3) {
	return abs((x1 *(y2 - y3) + x2 *(y3 - y1)+ x3 * (y1 - y2))/2.0);
}

bool pripadaPravoj(int x1, int y1, int x2, int y2){
    return y2 * (x2 - x1) == x2 * (y2 - y1);
}
bool suprotniKvadranti(int x1, int y1, int x2, int y2){
    return (x1 * x2 < 0 || (x1 == 0 && x2 == 0)) && (y1 * y2 < 0 || (y1 == 0 && y2 == 0));
}

bool pripadaPodskupu2(int x1, int y1, int x2, int y2){
    return pripadaPravoj(x1, y1, x2, y2) && suprotniKvadranti(x1, y1, x2, y2);
}
bool pripadaPodskupu3(int x1, int y1, int x2, int y2, int x3, int y3){
    float p1 = povrsinaTrougla(x1, y1, x2, y2, 0, 0);
	float p2 = povrsinaTrougla(x1, y1, x3, y3, 0, 0);
	float p3 = povrsinaTrougla(x2, y2, x3, y3, 0, 0);
	float ptrougla = povrsinaTrougla(x1, y1, x2, y2, x3, y3);
    if(ptrougla == 0){
        return pripadaPodskupu2(x1, y1, x2, y2)
            || (pripadaPodskupu2(x1, y1, x3, y3))
         ||(pripadaPodskupu2(x2, y2, x3, y3));
    }
	return (fabs(ptrougla - (p1 + p2 + p3)) < eps);
}


int main(){

    int x1, y1, x2, y2, x3, y3, N;
    cin >> N >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
    int br = 0;
    if(pripadaPodskupu2(x1, y1, x2, y2)) br++;
    if(pripadaPodskupu2(x1, y1, x3, y3)) br++;
    if(pripadaPodskupu2(x2, y2, x2, y3)) br++;
    if(pripadaPodskupu3(x1, y1 ,x2, y2, x3, y3)) br++;
    cout << br;

}